Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / December 2007

Tip: Looking for answers? Try searching our database.

clarification on Heaps please!

Thread view: 
Totti - 21 Dec 2007 19:12 GMT
hi all,
i am using Robert Lafore's book to learn JAVA, which i hope, you are
familiar with.
at any rate, in chapter 12 he is talking about HEAPS and he has the
code of making a heap of numbers, but since there are two kinds of
heaps Min and Max, the code covers only the Max which has the Parent
bigger than the children, so i am thinking of how could i change his
code to make it produce a minimun heap?
that is if you are familiar with the book, if you are not, would you
please give me some general info on how this thing works and what
should be altered to make it work otherwise i mean from max to min

any help appreciated and thanks in advance.
Daniel Pitts - 21 Dec 2007 19:19 GMT
> hi all,
> i am using Robert Lafore's book to learn JAVA, which i hope, you are
[quoted text clipped - 9 lines]
>
> any help appreciated and thanks in advance.
Heaps aren't specific to Java.

Changing a between a min-heap and a max-heap is as simple as reversing
the "<" to a ">" where appropriate.

Signature

Daniel Pitts' Tech Blog: <http://virtualinfinity.net/wordpress/>

Lew - 22 Dec 2007 02:05 GMT
Totti wrote:
>> i [sic] am using Robert Lafore's book to learn JAVA, which i hope, you are
>> familiar with.
[quoted text clipped - 6 lines]
>> please give me some general info on how this thing works and what
>> should be altered to make it work otherwise i mean from max to min

> Heaps aren't specific to Java.
>
> Changing a between a min-heap and a max-heap is as simple as reversing
> the "<" to a ">" where appropriate.

Was it in this thread that someone recently recommended
<http://bcs.wiley.com/he-bcs/Books?action=mininav&bcsId=3663&itemId=0470105550&as
setId=110292&resourceId=10137&newwindow=true
>

which has a very thorough, engaging and Java-centric discussion of heaps and
heapsort in that free chapter?

Signature

Lew



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.