World's most popular travel blog for travel bloggers.

[Solved]: What is postorder traversal on this simple tree?

, , No Comments
Problem Detail: 

Given the following tree:

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?

Asked By : Jorge Zapata

Answered By : Dave Clarke

You are not wrong.

A postorder traversal visits the left subtree, then the right subtree, then the root of the current tree (recursively).

Best Answer from StackOverflow

Question Source : http://cs.stackexchange.com/questions/1915

0 comments:

Post a Comment

Let us know your responses and feedback