You are here:

C++/Is heap an implicit data structure to implement priority queue?


My question might seem childish but I really don't understand this question as I am just a newbie to data structures course. I do know how max and min hip work, but I am not sure that whether heap is implicit data structure to implement priority queue.

Kindly clear my confusion.



I too don't really understand what the term 'an implicit data structure' means.

Perhaps, the question should have been: 'Is some kind of heap the only data structure that can be used to implement a priorority queue'?

The answer is no.

"It is a common misconception that a priority queue is a heap. A priority queue is an abstract concept like "a list" or "a map"; just as a list can be implemented with a linked list or an array, a priority queue can be implemented with a heap or a variety of other methods.
While relying on a heap is a common way to implement priority queues, for integer data faster implementations exist (this can even apply to datatypes that have finite range, such as floats)"
- Wiki  
Related Articles


All Answers

Answers by Expert:

Ask Experts




my primary areas of interest are generic and template metaprogramming, STL, algorithms, design patterns and c++11. i would not answer questions about gui and web programming.


about 15 years or so

post graduate engineer

©2016 All rights reserved.