Explanatory Question
How to check if a given Binary Tree is BST or not?
Read the answer carefully and go through the related questions on the right side to improve your understanding of this topic.
If inorder traversal of a binary tree is sorted, then the binary tree is BST. The idea is to simply do inorder traversal and while traversing keep track of previous key value. If current key value is greater, then continue, else return false.
First read the answer fully, then try to explain it in your own words. After that, open a few related questions and compare the concepts. This method helps you remember the topic for a longer time and improves exam preparation.