algorithm Check if a tree is BST or not If a given input tree follows Binary search tree property or not

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Extensions
> Step 2: And Like the video. BONUS: You can also share it!

Example

For example

if the input is:

enter image description here

Output should be false:

As 4 in the left sub-tree is greater than the root value(3)

If the input is:

enter image description here

Output should be true



Got any algorithm Question?