What is postorder traversal on this simple tree?
-
16-10-2019 - |
Question
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?
Solution
You are not wrong.
A postorder traversal visits the left subtree, then the right subtree, then the root of the current tree (recursively).
Licensed under: CC-BY-SA with attribution
Not affiliated with cs.stackexchange