Find the largest Binary Search Tree in a given Binary Tree.
…Solution will be posted soon.
Update : Solution
Traverse the tree. From each node to the parent, return the following
set of values.
- If BST, size of the current BST or -1 if the tree is not.
- Minval & Maxval of the subtree and maxbstsize seen so far (
probably using references)
So in each node check the following: