could somebody please tell me what (A*B) / (C^D^E) is in POST ORDER.
I drew the tree and went back over it in post order
From this I get :Code:/
* ^
A B C ^
D E
AB*C/D^E^, is this correct?
Printable View
could somebody please tell me what (A*B) / (C^D^E) is in POST ORDER.
I drew the tree and went back over it in post order
From this I get :Code:/
* ^
A B C ^
D E
AB*C/D^E^, is this correct?
First off, define exactly what you mean by post order.
I might point out that AB*C/D^E^ isn't a valid expression.
Tree traversal - Wikipedia, the free encyclopedia
To traverse a non-empty binary tree in postorder, perform the following operations recursively at each node[1]:
Traverse the left subtree.
Traverse the right subtree.
Visit the root.
@Kevin: I think the "right" postorder traversation will generate a non "valid expression" too....
The correct postfix expression (according to your tree) is: AB*CDE^^/
kind regards,
Jos
Thank you very much