##
K’th Largest Element in BST when modification to BST is not allowed
March 19, 2015

Given a Binary Search Tree (BST) and a positive integer k, find the k’th largest element in the Binary Search Tree.

March 19, 2015

Given a Binary Search Tree (BST) and a positive integer k, find the k’th largest element in the Binary Search Tree.

December 8, 2014

Given n appointments, find all conflicting appointments.

August 4, 2014

Following article is extension of article discussed here. In AVL tree insertion, we used rotation as a tool to do balancing after insertion caused imbalance.… Read More »

July 25, 2014

I recently encountered with a question in an interview at e-commerce company. The interviewer asked the following question:

June 27, 2014

Given a BST, transform it into greater sum tree where each node contains sum of all nodes greater than that node.

January 30, 2014

We have discussed BST search and insert operations. In this post, delete operation is discussed. When we delete a node, there possibilities arise.

The following is definition of Binary Search Tree(BST) according to Wikipedia Binary Search Tree, is a node-based binary tree data structure which has the following… Read More »

September 12, 2013

Given a Binary Search Tree (BST), modify it so that all greater values in the given BST are added to every node. For example, consider… Read More »

June 23, 2013

Given two arrays which represent a sequence of keys. Imagine we make a Binary Search Tree (BST) from each array. We need to tell whether… Read More »

March 29, 2013

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

March 10, 2013

Given a Balanced Binary Search Tree and a target sum, write a function that returns true if there is a pair with sum equals to… Read More »

March 9, 2013

Given a Balanced Binary Search Tree (BST), write a function isTripletPresent() that returns true if there is a triplet in given BST with sum equals… Read More »

January 1, 2013

Given a Binary Search Tree (BST), convert it to a Binary Tree such that every key of the original BST is changed to key plus sum of all greater keys in BST

October 17, 2012

There are numerous applications we need to find floor (ceil) value of a key in a binary search tree or sorted array.

October 11, 2012

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