MediumGCDs of given index ranges in an arrayProblem Statement The problem ‘GCDs of given index ranges in an array” states that you read more
EasyFind Maximum Level sum in Binary TreeProblem Statement The problem “Find Maximum Level sum in Binary Tree” states that you read more
EasyRed-Black Tree IntroductionRed Black Tree is a self-balancing binary tree. In this tree, every node is either a red node or a read more
MediumBinary Search Tree Delete OperationProblem Statement The problem “Binary Search Tree Delete Operation” asks us to read more
EasyIterative Method to find Height of Binary TreeProblem Statement The problem “Iterative Method to find Height of Binary Tree” states read more
MediumClone a Binary Tree with Random PointersProblem Statement You are given a complete binary tree with some random pointers. Random pointers read more
EasyCheck if all levels of two Binary Tree are anagrams or notProblem Statement The problem “Check if all levels of two Binary Tree are anagrams or read more
EasyAn Interesting Method to generate Binary Numbers from 1 to nProblem Statement The problem “An Interesting Method to generate Binary Numbers from 1 to read more
EasyCheck if the given array can represent Level Order Traversal of Binary Search TreeProblem Statement The problem “Check if the given array can represent Level Order Traversal read more
EasyNumber of siblings of a given Node in n-ary TreeProblem Statement The problem “Number of siblings of a given Node in n-ary Tree” states read more
EasyCheck whether a given Binary Tree is Complete or notProblem Statement The problem “Check whether a given Binary Tree is Complete or not” read more
EasyCount the number of nodes at given level in a tree using BFSDescription The problem “Count the number of nodes at given level in a tree using BFS” read more
EasyMinimum number of distinct elements after removing m itemsProblem Statement The problem “Minimum number of distinct elements after removing m read more
MediumConvert BST into a Min-Heap without using arrayProblem Statement “Convert BST into a Min-Heap without using array” problem states that read more
MediumMerge two BSTs with limited extra spaceProblem Statement The problem “Merge two BSTs with limited extra space” states that you read more
EasyBinary Tree to Binary Search Tree Conversion using STL setProblem Statement We are given a binary tree and we need to convert it into a binary search tree. read more
MediumK’th Largest element in BST using constant extra spaceProblem Statement “K’th Largest element in BST using constant extra space” states read more
EasyK’th Largest Element in BST when modification to BST is not allowedProblem Statement “K’th Largest Element in BST when modification to BST is not read more
EasyCheck if each internal node of a BST has exactly one childProblem Statement “Check if each internal node of a BST has exactly one child” problem states read more
EasyHeight of a generic tree from parent arrayProblem Statement “Height of a generic tree from parent array” problem states that you read more
EasyFind k-th smallest element in BST (Order Statistics in BST)Problem Statement “Find k-th smallest element in BST (Order Statistics in BST)” problem read more
EasyVertical sum in a given binary treeProblem Statement “Vertical sum in a given binary tree” problem states that you are given a read more
EasyA program to check if a binary tree is BST or notProblem Statement “A program to check if a binary tree is BST or not” states that you are given read more
EasyCheck for Identical BSTs without building the treesProblem Statement “Check for identical BSTs without building the trees” problem states that you read more
EasyMaximum Depth Of Binary TreeProblem Statement “Maximum depth of binary tree” problem states that you are given a read more
EasyConvert BST to Min HeapProblem Statement Given a complete Binary Search Tree, write an algorithm to convert it into a Min read more
MediumMerge Two Balanced Binary Search TreesProblem Statement Given Two Balanced Binary Search Trees, there are n elements in the first BST and read more
EasyBinary Search Tree Search and InsertionProblem Statement Write an algorithm to perform searching and insertion in Binary Search Tree. So read more
EasyConvert a normal BST to Balanced BSTProblem Statement Given a Binary Search Tree(BST), write an algorithm to convert the BST to a read more
MediumCheck given array of size n can represent BST of n levels or notProblem Statement Given an array with n elements, check given array of size n can represent BST of read more
MediumBinary Tree to Binary Search Tree ConversionIn binary tree to binary search tree conversion problem, we have given a binary tree convert it to read more
Sorted Linked List to Balanced BSTIn sorted linked list to balanced BST problem, we have given a singly Linked list in sorted order, read more
Sorted Array to Balanced BSTIn sorted array to balanced BST problem, we have given an array in sorted order, construct a read more
Transform a BST to Greater sum TreeIn transform a BST to greater sum tree Given a Binary Search Tree write an algorithm to convert it read more
Convert a BST to a Binary Tree such that sum of all greater keys is added to every keyGiven a Binary Search Tree, write an algorithm to Convert a BST to a Binary Tree such that the sum read more
Advantages of BST over Hash TableThe most commonly used operations on any data structure are insertion, deletion, and searching. read more
Construct BST from its given Level Order TraversalGiven the level order traversal of a Binary Search Tree, write an algorithm to construct the Binary read more
Construct BST from given Preorder TraversalGiven a pre-order traversal of a Binary Search Tree(BST), write an algorithm to construct the BST read more
BST to a Tree with Sum of all Smaller KeysIn this problem we have given a Binary Search Tree, write an algorithm to convert best to a tree read more
Find the node with minimum value in a Binary Search TreeGiven a Binary Search Tree, write an algorithm to find the node with the minimum value in a given read more
Construct Binary Tree from Given Inorder and Preorder TraversalsIn this problem, we have inorder and preorder of the binary tree. We need to construct a binary read more
Reverse a Path in BST using QueueIn reverse a path in BST using queue problem we have given a Binary Search Tree and node, write an read more
Print Ancestors of a Given Binary Tree Node Without RecursionGiven a binary tree and a specific node or key. Print ancestors of a given binary tree node without read more
Level order Traversal in Spiral FormIn this problem we have given a binary tree,  print its level order traversal in a spiral form. read more
Kth Smallest Element in a BSTIn this problem, we have given a BST and a number k, find the kth smallest element in a BST. read more
Balanced Binary TreeIn the balanced binary tree problem, we have given the root of a binary tree. We have to determine read more
Interval TreeIn the interval tree problem, we have given a set of intervals and three types of queries read more
Construct Complete Binary Tree from its Linked List RepresentationGiven the linked list representation of a complete binary tree. The linked list is in the order of read more
Lowest Common AncestorGiven the root of a binary tree and two nodes n1 and n2, find the LCA(Lowest Common Ancestor) of read more
Averages of Levels in Binary TreeIn averages of levels in binary tree problem we have given a binary tree, print the averages of all read more
Lowest Common Ancestor in Binary Search TreeGiven the root of a binary search tree and two nodes n1 and n2, find the LCA(Lowest Common read more
Segment TreeIf we have performing addition on a given range of array whose element values updated any time. read more
Print a Binary Tree in Vertical OrderIn this problem, we have given a pointer denoting the root of the binary tree and your task is to read more
Binary Search TreeA binary search tree is a Binary tree with some rules that allows us to maintain the data in a read more
Maximum Binary TreeIn this problem, we have given an array a[ ] of size n. Create the maximum binary tree from the read more
Binary Tree zigzag level order TraversalGiven a binary tree, print the zigzag level order traversal of its node values. (ie, from left to read more
Recover Binary Search TreeConsider a binary search tree, two nodes of the tree have been swapped, design an algorithm to read more
Populating Next Right Pointers in Each NodeGiven a Binary Tree, connect nodes that are at the same level from left to right. Structure of the read more
Top View of Binary TreeThe top view of a binary tree is the set of nodes visible when the tree is viewed from the top. read more
Level of Each node in a Tree from source nodeGiven a tree (an acyclic fully connected graph where constituent nodes are connected by read more
Find Duplicate SubtreesDuplicate Subtrees  Subtrees are said to be duplicate if they have the same node values and read more
Symmetric TreeIn Symmetric Tree problem we have given a binary tree, check whether it is a mirror of itself. A read more
Minimum Height TreesIn the Minimum Height Trees problem, we have given an undirected graph which is tree in nature read more
Trim a Binary Search TreeIn Trim a Binary Search Tree problem we have given a binary search tree and a lower (as L) and read more
Convert Sorted List to Binary Search TreeProblem Given a linked list. The elements of the linked list are in increasing order. Convert the read more
Validate Binary Search TreeProblem In Validate Binary Search Tree problem we have given the root of a tree, we have to check read more
Path SumWhat is Path Sum Problem? In the Path Sum problem, we have given a binary tree and an integer SUM. read more
Level Order Traversal of Binary TreeLevel Order Traversal of a given binary tree is the same as the BFS of the binary tree. Do we read more
Tree Traversal (Preorder, Inorder & Postorder)First, we need to know about what is Traversal in Binary Tree. Traversal is a type of method in read more
Deletion in a Binary TreeDo we already know about what actually Binary Tree is? Now in this post, we are focusing on how to read more
Unique Binary Search TreesFirstly we have to find the total number of counts to form a unique binary search tree. After it, read more
Decision TreeDecision Tree is a decision support tool that helps us for finding the best result. It’s used read more
Verify Preorder Serialization of a Binary TreeFirst, we need to know what actually Preorder of a Binary Tree is. Preorder is a type of Binary read more
Binary Tree Data StructureIn this article, we will read about the Binary Tree Data Structure. Trees are hierarchical data read more
Types of Binary TreeBefore we proceed, we first know what BT really is? Binary Tree is a type of data structure that is read more
Insertion in a Binary TreeIn this article, we will learn the insertion in a binary tree. We have already seen the concept of read more
Serialize and Deserialize Binary TreeWe have given a binary tree containing N number of nodes where each node has some value. We need to read more
Delete a TreeTime Complexity : O(n) Space Complexity :O(1) Here we use, Post-Order traversal method to delete read more
Binary TreeBinary Tree is fundamental data structure, where we can easily store and retrieve data. It is made read more
Searching a node in a Binary Search TreeSearching a data value in a Binary Search Tree. It says whether the data value is present or not in read more
Binary Tree Level order traversal in JavaLevel order traversal or breadth first traversal is traversing the same level nodes of a tree then read more
Java program to find the number of Nodes in a Binary TreeTotal number of nodes in a binary tree is known as a size of a tree. We have to write a program in read more