Given a binary tree, determine if it is a valid binary search tree (BST).
Assume a BST is defined as follows:
Example :
Input :
1
/ \
2 3
Output : 0 (False)
Input :
2
/ \
1 3
Output : 1 (True)
Return 0 / 1
( 0 for false, 1 for true ) for this problem
SOLUTION APPROACH :
VIDEO : https://www.youtube.com/watch?v=yEwSGhSsT0U
Complete solution in the hints.
NOTE: You only need to implement the given function. Do not read input, instead use the arguments to the function. Do not print the output, instead return values as specified. Still have a question? Checkout Sample Codes for more details.