Tree Traversal

Basic Tree Traversal

 

Example Tree

Depth First Traversal:

1. In order traversal----left, root, right----4,2,5,1,3

2. Pre order traversal-----root, left, right-----1,2,4,5,3

3. Post order traversal----left,right,root----4,5,2,3,1

Breadth First Traversal (level order)

 

Post order traversal used at tree deletion

 

posted on 2014-11-27 07:25  SuperBo  阅读(109)  评论(0编辑  收藏  举报