Thursday 12 September 2013

TRAVERSING BINARY TREES !!

PREORDER
1.Process the root R.
2.Traverse the left subtree of R in preorder.
3.Traverse the right subtree of R in preorder.

INORDER

1.Traverse the left subtree of R in inorder.
2.Process the root R.
3.Traverse the right subtree of R in inorder.

POSTORDER
1.Traverse the left subtree of R in postorder.
2.Traverse the right subtree of R in postorder.
3.Process the root R.

No comments:

Post a Comment