Re: please help with this question
- From: Lew <lew@xxxxxxxxxxxxx>
- Date: Sun, 30 Dec 2007 10:17:00 -0500
Eric Sosman wrote:
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!)
To the OP: If you're asking for help with your homework, you get honesty points for saying so up front. No one has respect for an unadorned verbatim quote of your assignment ***. If you aren't quoting your homework, you should say that, too.
Furthermore, simply throwing the question out there for someone else to answer cheats you of your education, unless, of course, you get a good solid hint like Eric's and you use it, reason over it, truly grok the process.
Please do report on your progress - in other words, please post your answer so the rest of us can benefit, too.
--
Lew
.
- Follow-Ups:
- Re: please help with this question
- From: Totti
- Re: please help with this question
- References:
- please help with this question
- From: Totti
- Re: please help with this question
- From: Eric Sosman
- please help with this question
- Prev by Date: Re: Open Source Java Quicksilver for Windows/Linux
- Next by Date: Re: please help with this question
- Previous by thread: Re: please help with this question
- Next by thread: Re: please help with this question
- Index(es):