An open API service indexing awesome lists of open source software.

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

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";
}
}
```