##
Largest number in BST which is less than or equal to N
July 5, 2017

We have a binary search tree and a number N. Our task is to find the greatest number in the binary search tree that is… Read More »

July 5, 2017

We have a binary search tree and a number N. Our task is to find the greatest number in the binary search tree that is… Read More »

June 29, 2017

Given an array of N element. The task is to check if it is Inorder traversal of any Binary Search Tree or not. Print “Yes”… Read More »

June 17, 2017

Given a binary search tree which is also a complete binary tree. The problem is to convert the given BST into a Min Heap with… Read More »

June 16, 2017

Given a Binary Search Tree, find median of it. If no. of nodes are even: then median = ((n/2th node + (n+1)/2th node) /2 If… Read More »

Given a Preorder traversal of a Binary Search Tree. The task is to print leaf nodes of the Binary Search Tree from the given preorder.… Read More »

May 28, 2017

A threaded binary tree node looks like following. We have already discussed Insertion of Threaded Binary Search Tree In deletion, first the key to be… Read More »

May 16, 2017

Given a Binary Tree, write a function that returns the size of the largest subtree which is also a Binary Search Tree (BST). If the… Read More »

May 13, 2017

We have already discuss the Binary Threaded Binary Tree. Insertion in Binary threaded tree is similar to insertion in binary tree but we will have… Read More »

April 22, 2017

We have discussed simple BST insert. How to insert in a tree where parent pointer needs to be maintained. Parent pointers are helpful to quickly… Read More »

January 22, 2017

Given an array of N elements and two integers A, B which belongs to the given array. Create a Binary Search Tree by inserting element… Read More »

January 14, 2017

Given Binary Search Tree. The task is to find sum of all elements smaller than and equal to Kth smallest element. Examples: Input : K… Read More »

January 2, 2017

Given a Binary search Tree that contains positive integer values greater then 0. The task is to check whether the BST contains a dead end… Read More »

December 31, 2016

Given a binary search tree and a target node K. The task is to find the node with minimum absolute difference with given target value… Read More »

December 15, 2016

Given two Binary Search Trees (BST) and a given sum. The task is to find pairs with given sum such that each pair elements must… Read More »

Given a binary search tree and a sorted sub-sequence. the task is to check if the given sorted sub-sequence exist in binary search tree or… Read More »