## Find K’th smallest and K’th largest element in BST

Given a Binary Search Tree and a positive number K, find K’th smallest and K’th largest element in BST.

## Find Lowest Common Ancestor (LCA) of two nodes in a BST

Given a BST and two nodes x and y in it, find lowest common ancestor (LCA) of x and y in it.

## Find Inorder Predecessor for given key in a BST

Given a BST, find in-order predecessor of a given key in it. If the given key do not lie in the BST, then return the previous greater key (if any) present in the BST.   An in-order predecessor of a node in BST is the previous node in in-order traversal of it.

## Check if given keys represents same BSTs or not without building the BST

Given two arrays which represents set of BST keys, check if they represents same BSTs or not. We are not allowed to build the tree.

## Determine if given Binary Tree is a BST or not

Given a Binary Tree, determine if it is a BST or not.   This problem has a simple recursive solution. The BST property “every node on the right subtree has to be larger than the current node and every node on the left subtree has to be smaller than the current node” is the key …

## Construct balanced BST from given keys

Given an unsorted array of integers which represents binary search tree keys, construct a height balanced BST from it.

## Deletion from BST (Binary Search Tree)

Given a BST, write an efficient function to delete a given key in it.

## Search given key in BST | Recursive & Iterative Solution

Given a BST, write an efficient function to search a given key in it. The algorithm should return the parent node of the key and print if the key is left or right node of the parent node. If the key is not present in the BST, the algorithm should be able to determine that.

## Insertion in BST | Recursive & Iterative Solution

A Binary Search Tree (BST) is a rooted binary tree, whose nodes each store a key (and optionally, an associated value) and each have two distinguished sub-trees, commonly denoted left and right. The tree should satisfy the BST property, which states that the key in each node must be greater than all keys stored …

## Find Optimal Cost to Construct Binary Search Tree

Find optimal cost to construct binary search tree where each key can repeat several times. We are given frequency of each key in same order as corresponding keys in inorder traversal of a binary search tree.