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.

1 comment:

  1. An O(n) algorithm http://tech-queries.blogspot.com/2010/09/diameter-of-tree-in-on.html

    ReplyDelete