Tuesday, February 7, 2012

Basics of trees

http://www.stanford.edu/~blp/avl/libavl.html/

Height of NULL node is -1. Height of a node with left and right nodes as null is 0.
Different Types of Binary Trees.

Leaf Node: Node with left and right as null nodes.

1. Full Binary Tree . Each node except leaf node is having compulsorily two children.

2. Perfect Binary Tree: All leaf nodes are at same height.

3. Complete Binary Tree: All nodes except leaf nodes are at same level. And leaf nodes should be present at left .

http://en.wikipedia.org/wiki/Binary_tree

Height of a AVL Tree
http://lcm.csa.iisc.ernet.in/dsa/node112.html