|
-
September 4th, 2012, 10:59 PM
#3
Re: Need Help - Recursive Algorithm
 Originally Posted by pradeepc
is correct .
It looks right to me.
Postorder has this recursive structure:
Left branch.
Right branch.
Print.
It visits all nodes all way down to I. Then it retracts while printing in reverse order from I and up.
Inorder looks like this:
Left branch.
Print.
Right branch.
It visits the left nodes all way down to G where it prints and continues to the right. Since the nodes below G don't have a left branch they get printed too on the way down to I. Then it retracts while printing all nodes above G in reverse order on the way back up.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|