An online placement forum.

You are not connected. Please login or register

Largest BST in a binary tree

Go down  Message [Page 1 of 1]

1 Largest BST in a binary tree on Wed Oct 12, 2011 10:03 pm

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


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.

View user profile

Back to top  Message [Page 1 of 1]

Permissions in this forum:
You cannot reply to topics in this forum