Click here to Skip to main content
15,885,757 members
Please Sign up or sign in to vote.
2.33/5 (3 votes)
See more:
Why we need Heap what is its purpose
Posted

Like any data structure, it is used because it simplifies some process. Some examples of problems that use heaps can be found here[^].
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 12-Sep-12 18:05pm    
One of the best ways to answer such questions; my 5.
--SA
This[^] will tell you all you need to know about the heap.
 
Share this answer
 
Comments
lewax00 12-Sep-12 13:12pm    
Based on his question title, I don't think he meant "the heap", just the general data structure.
[no name] 12-Sep-12 14:06pm    
And his actual question has nothing to do with data structures.
lewax00 12-Sep-12 14:27pm    
Sure it does: there is a data structure called a heap. Asking why such a data structure is useful makes plenty of sense.
[no name] 12-Sep-12 14:36pm    
That is only supposing that he is asking about a data structure and not the heap. It is not obvious to me what 'heap' he is asking about. Just becasue he put "data structure" in the title and then asks a question that has nothing to do with data structures does not ncessarily mean he is asking about a data structure named "heap" or asking about the storage "heap". If this were the compiler it would throw up a warning that "heap" is ambiguous.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900