Write a code in C/C++ to find the largest BST sub-tree in a binary tree .
Eg:-
10
/ \
5 15
Define Largest:
Total no of nodes in sub-tree
or
Height of sub-tree
On Sun, Jul 10, 2011 at 8:50 PM, Decipher ankurseth...@gmail.com wrote:
Write a code in C/C++ to find the largest BST sub-tree in a binary tree .
Eg:-
10
no of nodes
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To view this discussion on the web visit
https://groups.google.com/d/msg/algogeeks/-/MuNISw2QkYIJ.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe
can be done using some modification in postorder traversal
call to left subtree will return that if left subtree is a BST of not
call to right subtree will return that if right subtree is a BST of not
if both subtrees are BST's check for curr and return its status
2 additional pass by ref.