renaming
This commit is contained in:
committed by
JamesFlare1212
parent
931a516fe9
commit
6f1fad433d
20
lectures/23_priority_queues/max_heap.cpp
Normal file
20
lectures/23_priority_queues/max_heap.cpp
Normal file
@@ -0,0 +1,20 @@
|
||||
#include <iostream>
|
||||
#include <queue>
|
||||
|
||||
int main() {
|
||||
std::priority_queue<int> maxHeap;
|
||||
|
||||
maxHeap.push(3);
|
||||
maxHeap.push(4);
|
||||
maxHeap.push(3);
|
||||
maxHeap.push(1);
|
||||
maxHeap.push(5);
|
||||
|
||||
while (!maxHeap.empty()) {
|
||||
std::cout << maxHeap.top() << " ";
|
||||
maxHeap.pop();
|
||||
}
|
||||
std::cout << std::endl;
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user