## Optimal sequence for AVL tree insertion (without any rotations)

Given an array of integers, the task is to find the sequence in which these integers should be added to an AVL tree such that… Read More »

- Two nodes of a BST are swapped, correct the BST | Set-2
- Total number of possible Binary Search Trees using Catalan Number
- Merge two BSTs with constant extra space
- Find the node with maximum value in a Binary Search Tree using recursion
- Lexicographically Smallest Topological Ordering
- Sum of all the levels in a Binary Search Tree
- Pair with a given sum in BST | Set 2
- Find the node with minimum value in a Binary Search Tree using recursion
- Number of pairs with a given sum in a Binary Search Tree
- Implementing Forward Iterator in BST
- Print Binary Search Tree in Min Max Fashion
- Generate two BSTs from the given array such that maximum height among them is minimum
- Pair with minimum absolute difference | BST
- Triplet with a given sum in BST | Set 2
- Nodes from given two BSTs with sum equal to X
- Implementing a BST where every node stores the maximum number of nodes in the path till any leaf
- Red-Black Trees | Top-Down Insertion
- Flatten BST to sorted list | Increasing order
- Implementing Backward Iterator in BST
- Pre-Order Successor of all nodes in Binary Search Tree
- Find the minimum absolute difference in two different BST's
- Find maximum count of duplicate nodes in a Binary Search Tree
- Flatten BST to sorted list | Decreasing order

Given an array of integers, the task is to find the sequence in which these integers should be added to an AVL tree such that… Read More »

Given the height of an AVL tree ‘h’, the task is to find the minimum number of nodes the tree can have. Examples : Input… Read More »

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

Given a Binary Search Tree (BST) and a range [min, max], remove all keys which are inside the given range. The modified tree should also… Read More »

Given postorder traversal of a binary search tree, construct the BST. For example, 1. If the given traversal is {1, 7, 5, 50, 40, 10},… Read More »

A recursive approach to insert a new node in a BST is already discussed in the post: Binary Search Tree | SET 1. In this… Read More »

Given Q queries. The queries are of three types and are described below: Add the number num to the list. Remove the number num from… Read More »

Given the root nodes of the two binary search trees. The task is to print 1 if the two Binary Search Trees are identical else… Read More »

Given two arrays which represent two sequences of keys that are used to create BSTs. Imagine we make a Binary Search Tree (BST) from each… Read More »

Given a BST and a number. The task is to check whether the given number is equal to the sum of all the node from… Read More »

Given a BST and a key Node, find the total sum in BST, except those Node which are adjacent to key Node. Examples: Recommended: Please… Read More »

Given a preorder traversal of a BST. The task is to find the number of elements less than root. Examples: Input: preorder[] = {3, 2,… Read More »

Consider a problem where same elements are likely to be searched again and again. Implement search operation efficiently. Examples : Input : arr[] = {12… Read More »

Given an array of positive and negative integers and an integer K. The task is to find the subarray which has its sum closest to… Read More »

Given an array of distinct elements, print the closest greater element for every element. The closest greater element for an element x is the smallest… Read More »