C++ program to swap all odd and even bits

By Sonal Bera

In this tutorial, we try to find a way by which we can swap all the odd and even bits. Say we have a number 76, we swap it at the bit level and convert it into 140. What we do is t.... Read More

Find Frequency of each element in an unsorted array in Python

By Amruth Kumar

In this tutorial, we are going to learn how to find the frequency of each element in an unsorted array in Python. For finding frequencies dictionaries can be used. You can check: .... Read More

Find shortest path with exactly k edges in a directed and weighted graph in C++

By Nimish Dham

Given a directed and weighted graph, we have to find the shortest path between two vertices that have exactly k edges. In a directed graph, an edge only exists in one direction, i..... Read More

Number of unique BSTs with n nodes in C++

By Nimish Dham

A BST(Binary Search Tree) is a kind of binary tree wherein the left subtree of a node contains nodes with values less than that of the node and the right subtree of the node contai.... Read More

Reverse a stack without using extra space in O(n) in C++

By Nimish Dham

Reversing a stack made using the stack library from STL in C++ without using extra space isn’t possible as we will have to store the stack elements in some auxiliary space as.... Read More

Check if a specific key is present in Swift dictionary

By Samim

In this tutorial, we will see how to check if a specific key is present in a Swift dictionary. Below are some methods to check if a specific key is present or not. We can do this .... Read More

Update parent view from child in SwiftUI

By shagrafnasheet

If we want to change or update the value of any property in SwiftUI, we use the State property wrapper. SwiftUI keeps track of State properties and automatically updates all the vi.... Read More

Replace Tkinter label text on button press in Python

By yaswanth vakkala

In this tutorial, let’s learn how to replace the tkinter label text on button press in Python. tkinter is the Python standard interface to the Tk/Tcl GUI toolkit. Using the t.... Read More

Related Posts