Wednesday, December 14, 2011

LCA in a Binary Tree or BST

1. LCA in a Binary Search Tree.

http://www.geeksforgeeks.org/lowest-common-ancestor-in-a-binary-search-tree/
http://articles.leetcode.com/lowest-common-ancestor-of-a-binary-search-tree/

2. LCA in a Binary Tree.

http://www.geeksforgeeks.org/lowest-common-ancestor-binary-tree-set-1/
http://articles.leetcode.com/lowest-common-ancestor-of-a-binary-tree-part-i

Parent PointerApproach:
http://www.geeksforgeeks.org/lowest-common-ancestor-in-a-binary-tree-set-2-using-parent-pointer/
http://articles.leetcode.com/lowest-common-ancestor-of-a-binary-tree-part-ii

RMQ Approach:
http://www.geeksforgeeks.org/find-lca-in-binary-tree-using-rmq/

3. Minimum Distance between two nodes in a BST/BT
http://www.geeksforgeeks.org/find-distance-two-given-nodes/
http://algorithms.tutorialhorizon.com/find-the-distance-between-two-nodes-of-a-binary-tree/

1 comment:

  1. http://tech-queries.blogspot.com/2010/04/isomorphic-trees.html

    http://tech-queries.blogspot.com/2010/04/quasi-isomorphic-trees.html

    ReplyDelete