Re: please help with this question



Totti wrote:
Hi all, Happy new year first of all, to all of you.

i am wondering about what would be the answer of the following:

Is there a heap 'X', sorting 'n' distinct elements (n = 7 for
instance) such that :

- a preorder traversal of 'X' yields the elements of 'X' in sorted
order?
- how about an inorder traversal?
- how about a postorder traversal?

Thanks in advance for any help.

For n = 0, all three traversals produce sorted order.

For n = 1, all three traversals produce sorted order.

Et cetera.

(Your instructor will be especially impressed if you use
the phrase "mathematical induction" to describe this method
of proof. Good luck!)

--
Eric Sosman
esosman@xxxxxxxxxxxxxxxxxxxx
.