This commit is contained in:
Jidong Xiao
2025-04-04 12:07:35 -04:00
committed by JamesFlare1212
parent 931a516fe9
commit 6f1fad433d
3 changed files with 240 additions and 0 deletions

View 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;
}