summaryrefslogtreecommitdiff
path: root/content/datastructures/stlPriorityQueue.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'content/datastructures/stlPriorityQueue.cpp')
-rw-r--r--content/datastructures/stlPriorityQueue.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/content/datastructures/stlPriorityQueue.cpp b/content/datastructures/stlPriorityQueue.cpp
new file mode 100644
index 0000000..32b2455
--- /dev/null
+++ b/content/datastructures/stlPriorityQueue.cpp
@@ -0,0 +1,8 @@
+#include <ext/pb_ds/priority_queue.hpp>
+template<typename T>
+using pQueue = __gnu_pbds::priority_queue<T>; //<T, greater<T>>
+
+auto it = pq.push(5);
+pq.modify(it, 6);
+pq.join(pq2);
+// push, join are O(1), pop, modify, erase O(log n) amortized