https://github.com/agauniyal/pq
different priority queue implementations
https://github.com/agauniyal/pq
cpp cpp17 priority-queue
Last synced: over 1 year ago
JSON representation
different priority queue implementations
- Host: GitHub
- URL: https://github.com/agauniyal/pq
- Owner: agauniyal
- License: mit
- Created: 2018-04-14T11:14:08.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-04-15T06:13:56.000Z (about 8 years ago)
- Last Synced: 2025-01-28T10:24:01.283Z (over 1 year ago)
- Topics: cpp, cpp17, priority-queue
- Language: C++
- Size: 2.93 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# pq
Different priority queue implementations
```cpp
#include "include/manual_heap-pq.hpp"
#include
int main()
{
PQ q;
q.push({ 10, 100, 20, 30, 5, 1 });
try {
std::cout << q.pop().value() << '\n'
<< q.pop().value() << '\n'
<< q.pop().value() << '\n'
<< q.pop().value() << '\n'
<< q.pop().value() << '\n'
<< q.pop().value() << '\n'
<< q.pop().value() << '\n';
} catch (std::bad_optional_access &e) {
std::cout << "Intentional bad access after 6 elements!\n";
}
}
```