Tuesday, August 9, 2011
Find the diameter of a BST
Find the diameter of a binary search tree.
Hint: this can be either in the left sub-tree or in the right-subtree or crossing the root.
Hint: this can be either in the left sub-tree or in the right-subtree or crossing the root.
Subscribe to:
Post Comments (Atom)
1 comment:
An O(n) algorithm http://tech-queries.blogspot.com/2010/09/diameter-of-tree-in-on.html
Reply Delete