Skip to content
/ pq Public

different priority queue implementations

License

Notifications You must be signed in to change notification settings

agauniyal/pq

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pq

Different priority queue implementations

#include "include/manual_heap-pq.hpp"
#include <iostream>

int main()
{
    PQ<int> 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";
    }
}

About

different priority queue implementations

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages