Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
In the C++ STL, priority_queue (heap) can be used with any underlying container, such as a deque (doubly linked list). How does the implementation stay O(log n) if deques don't swap an item in index a with index b in constant time?
In the C++ STL, priority_queue (heap) can be used with any underlying container, such as a deque (doubly linked list). How does the implementation stay O(log n) if deques don't swap an item in index a with index b in constant time?
In the C++ STL, priority_queue (heap) can be used with any underlying container, such as a deque. How does the implementation stay O(log n) if deques don't swap an item in index a with index b in constant time?
How does a priority_queue maintain a heap on a deque efficiently?
In the C++ STL, priority_queue (heap) can be used with any underlying container, such as a deque (doubly linked list). How does the implementation stay O(log n) if deques don't swap an item in index a with index b in constant time?