The problem states that we will be given a binary tree and we have to determine if it is a valid binary search tree(BST) or not. you can find this problem in Leetcode and in Hackerrank.

First of all, what is a binary tree?

A binary tree is a tree that has at most two child nodes.

Then what is a binary search tree?

A binary search tree(BST) is a kind of binary tree where each node is greater than its left node and smaller than its right node.

If you do not know how to implement a binary search…

Shaila Nasrin

Software Engineer at LogMeIn

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store