Medium Accuracy: 21.58% Submissions: 100k+ Points: 4
Given a binary tree. Check whether it is a BST or not.
You don't need to read input or print anything. Your task is to complete the function isBST() which takes the root of the tree as a parameter and returns true if the given binary tree is BST, else returns false. The printing is done by the driver's code.
Expected Time Complexity: O(N). Expected Auxiliary Space: O(Height of the BST).
0 <= Number of edges <= 100000
Note: The Input/Output format and Example are given are used for the system's internal purpose, and should be used by a user for Expected Output only. As it is a function problem, hence a user should not read any input from the stdin/console. The task is to complete the function specified, and not to write the full code.