# Tag Archives: Binary Search Trees

## Kth Smallest element in a Perfect Binary Search Tree

Given a Perfect BST with N nodes and an integer K, the task is to find the Kth smallest element in present in the tree.… Read More »

## Check if the Binary Tree contains a balanced BST of size K

Given a Binary Tree and a positive integer K. The task is to check whether the Balanced BST of size K exist in a given… Read More »

## Binary Search Tree | Set 3 (Iterative Delete)

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

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 »

## Check if value exists in level-order sorted complete binary tree

Given a level-order sorted complete binary tree, the task is to check whether a key exists in it or not. A complete binary tree has… Read More »

## Find Leftmost and Rightmost node of BST from its given preorder traversal

Given a preorder sequence of the binary search tree of N nodes. The task is to find its leftmost and rightmost node. Examples: Input :… Read More »

## Find all the pairs with given sum in a BST | Set 2

Given a Binary Search Tree and an integer sum, the task is to find all the pairs from the tree whose sum is equal to… Read More »

## Sum of cousin nodes of a given node in a BST

Given a binary search tree and a number N, the task is to find the sum of the cousins of the given node N if… Read More »

## Smallest number in BST which is greater than or equal to N ( Iterative Approach)

Given a Binary Search Tree and a number N, the task is to find the smallest number in the binary search tree that is greater… Read More »

## Sum of K largest elements in BST using O(1) Extra space

Given a BST, the task is to find the sum of all elements greater than or equal to K-th largest element in O(1) space. Examples:… Read More »

## Special two digit numbers in a Binary Search Tree

Given a Binary Search Trees, task is to count the number of nodes which are having special two digit numbers. Prerequisite : Special Two Digit… Read More »

## Data Structures | Binary Search Trees | Question 12

Consider the same code as given in above question. What does the function print() do in general? The function print() receives root of a Binary… Read More »

## Data Structures | Binary Search Trees | Question 12

Consider the following code snippet in C. The function print() receives root of a Binary Search Tree (BST) and a positive integer k as arguments.… Read More »

## Data Structures | Binary Search Trees | Question 10

Which of the following traversals is sufficient to construct BST from given traversals 1) Inorder 2) Preorder 3) Postorder (A) Any one of the given… Read More »

## Data Structures | Binary Search Trees | Question 12

Consider the following Binary Search Tree 10 / \ 5 20 / / \ 4 15 30 / 11 If we randomly search one of… Read More »