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 or False
Input :
2
/ \
1 3
Output : 1 or True
Return 0 / 1
( 0 for false, 1 for true ) for this problem
SOLUTION APPROACH :
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 doubt? Checkout Sample Codes for more details.