# Find the nearest integer of a given number in the binary search tree.

Given a Binary Search Tree (BST) contains integers and an integer. We aim to find the nearest node to input integer in the BST. Let us understand this with an example. Let’s see how our solution works to get the nearest node to the target integer. This algorithm runs with O(H), where is ‘H’ isRead More »

# Find two nodes with a given sum in a binary search tree.

We were given a binary search tree(BST) and a sum. We aim to find any two nodes with a total that is equivalent to input sum. Let us see this with an example. In the above BST, we are going to find a sum of two nodes as 9. Our approach to solve this, firstlyRead More »

# How to check a binary tree is BST or not

Given any binary tree, the aim is to find the given tree is BST or not. First of all, we need to see what are the properties of a BST. It is a binary tree (has all binary tree properties) All left children are less than the root value. Whereas all right children are greaterRead More »

# Find ceil of a given node in the binary search tree

Ceil of a node in a given binary search tree is defined as a node that is equal to or nearest maximum node of the given node. Let’s take the below picture, which demonstrates the ceiling node of the input node. We can consider this problem is as similar to finding a node in aRead More »