Given an unsorted vector arr, the task is to create a balanced binary search tree using the elements of the array. Note: There can be… Read More

# Tag Archives: BST

AVL Tree is a self-balancing Binary Search Tree (BST) where the difference between heights of left and right subtrees cannot be more than one for… Read More

Given a Binary Search Tree consisting of N distinct nodes, the task is to flatten the given Binary Search Tree to convert the tree into… Read More

Given a Binary Search Tree, the task is to create a wave array from the given Binary Search Tree. An array arr[0..n-1] is called a… Read More

A Set is a collection of distinct elements. Elements cannot be modified once added. There are various operations associated with sets such as union, intersection,… Read More

AVL Trees are self-balancing Binary Search Trees where the difference between heights of left and right subtrees cannot be more than one for all nodes.… Read More

Given two positive integers N and K, the task is to find the number of binary search trees (BST) with N nodes of height greater… Read More

Given a Binary Search Tree consisting of N nodes and two positive integers L and R, the task is to find the sum of values… Read More

Given a Binary Tree, the task is to check if the given binary tree is a Binary Search Tree or not. If found to be… Read More

Given a string S of length N, and Q queries of the following type: Type 1: 1 i X Update the i-th character of the… Read More

Given a binary search tree and a node of the binary search tree, the task is to delete the node from the Binary Search tree… Read More

Double Threaded Binary Search Tree: is a binary search tree in which the nodes are not every left NULL pointer points to its inorder predecessor… Read More

Given a binary search tree containing N distinct nodes and a value K. The task is to count pairs in the given binary search tree… Read More

Construct the BST (Binary Search Tree) from its given level order traversal. Examples: Input : {7, 4, 12, 3, 6, 8, 1, 5, 10} Output… Read More

Given a binary search tree. The task is to print all even nodes of the binary search tree.Examples: Input : 5 / \ 3 7… Read More