Given a binary tree return the largest BST ( binary search tree ) present in the binary tree.
/*
The function shall return the root of the largest BST and its size (number of nodes)
*/
NOTE: The largest BST may or may not include all its descendants
---------------------
Variants:
What if the following additional constraint is added to the above problem:
- The largest BST also needs to be a subtree of the given binary tree i.e. it must include all its descendants.
/*
The function shall return the root of the largest BST and its size (number of nodes)
*/
NOTE: The largest BST may or may not include all its descendants
---------------------
Variants:
What if the following additional constraint is added to the above problem:
- The largest BST also needs to be a subtree of the given binary tree i.e. it must include all its descendants.