// Copyright 2019, University of Freiburg, // Chair of Algorithms and Data Structures. // Authors: Patrick Brosi #ifndef UTIL_PRIORITYQUEUE_H_ #define UTIL_PRIORITYQUEUE_H_ #include #include #include namespace util { template class PriorityQueue { struct _ByFirst { bool operator()(const std::pair& a, const std::pair& b) { return a.first > b.first; } }; public: PriorityQueue() : _last(std::numeric_limits::lowest()) {} void push(K k, const V& v); const K topKey() ; const V& topVal() ; void pop(); bool empty() const; private: K _last; std::priority_queue, std::vector>, _ByFirst> _pq; }; #include "util/PriorityQueue.tpp" } // namespace util #endif