User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the Computer Science and Software Design section within the Software Development category of DaniWeb, a massive community of 456,468 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,780 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Computer Science and Software Design advertiser: Programming Forums
Views: 1354 | Replies: 1
Reply
Join Date: May 2006
Posts: 17
Reputation: jaden403 is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 0
jaden403 jaden403 is offline Offline
Newbie Poster

Heap Data Structure

  #1  
Sep 15th, 2007
If I were to implement a heap constructed of integer values, does it matter that the root is not the smallest value? In my algorithm book it always shows the root being the smallest value given. But the Wiki entry shows the root as being the largest value.
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Sep 2004
Posts: 6,515
Reputation: Narue has much to be proud of Narue has much to be proud of Narue has much to be proud of Narue has much to be proud of Narue has much to be proud of Narue has much to be proud of Narue has much to be proud of Narue has much to be proud of Narue has much to be proud of Narue has much to be proud of 
Rep Power: 31
Solved Threads: 488
Super Moderator
Narue's Avatar
Narue Narue is offline Offline
Expert Meanie

Re: Heap Data Structure

  #2  
Sep 15th, 2007
>does it matter that the root is not the smallest value?
If you designed it to be then yes, because that's a bug in your implementation. But as you describe the problem, your book is showing a min heap and the wiki article is showing a max heap. Both are variations of the heap priority property.
I'm here to prove you wrong.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb Computer Science and Software Design Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the Computer Science and Software Design Forum

All times are GMT -4. The time now is 2:21 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC