Given the following tree:
Which traversal method would give as result the following output: CDBEA?
The answer in my study guide is Postorder, but I think postorder would output: DEBCA. Am I wrong?
Computer Science Stack Exchange is a question and answer site for students, researchers and practitioners of computer science. It only takes a minute to sign up.
Sign up to join this communityGiven the following tree:
Which traversal method would give as result the following output: CDBEA?
The answer in my study guide is Postorder, but I think postorder would output: DEBCA. Am I wrong?
You are not wrong.
A postorder traversal visits the left subtree, then the right subtree, then the root of the current tree (recursively).