- #1
gfd43tg
Gold Member
- 950
- 50
Hello,
There are three different orders of traversal that we learned about
##\bullet## pre-order traversal
##\bullet## in-order traversal
##\bullet## post-order traversal
Anyone know of any easy ways of remembering these 3 and how to order them? I have posted my lecture slides, but I could imagine the tree looking differently and then not knowing how to adapt and analyze how the calls would be made to a different looking tree.
Also, when one writes a recursive program, which order of traversal is taken? Is there some sort of default? Why are there 3 ways of traversing?
There are three different orders of traversal that we learned about
##\bullet## pre-order traversal
##\bullet## in-order traversal
##\bullet## post-order traversal
Anyone know of any easy ways of remembering these 3 and how to order them? I have posted my lecture slides, but I could imagine the tree looking differently and then not knowing how to adapt and analyze how the calls would be made to a different looking tree.
Also, when one writes a recursive program, which order of traversal is taken? Is there some sort of default? Why are there 3 ways of traversing?
Attachments
Last edited: