No
Consider 2 trees below
Tree1
a
b
Tree 2
a
b
preorder = ab
postorder = ba
Preorder and postorder do not uniquely define a binary tree.Nor do preorder and level order (same example).
Given an expression tree, evaluate the expression and obtain a paranthesized form of the expression.
|
Monday, November 1, 2010
Data Structures Part 6
Can you construct a tree using postorder and preorder traversal?
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment