I am bit confused between Heap and priority_queue in C++ STL. Does priority_queue really produce a Heap?
If we insert elements in order - 5, 1, 10, 30, 20 Output for maxHeap will be: 30, 20, 5, 1, 10 While output for priority_queue will be: 30, 20, 10, 5, 1
What is the reason behind this?
Is priority_queue always sorted?