Open
Graph Drawing
Framework

 v. 2020.02 (Catalpa)
 

bprioqueue.h
Go to the documentation of this file.
1 
31 #pragma once
32 
33 #include <ogdf/lib/abacus/bheap.h>
34 
35 namespace abacus {
36 
38 
56 template<class Type, class Key>
57 class AbaPrioQueue : public AbacusRoot {
58 public:
59 
61 
65  AbaPrioQueue(int size);
66 
68 
72  void insert(Type elem, Key key);
73 
75 
81  int getMin(Type &min) const;
82 
84 
90  int getMinKey(Key &minKey) const;
91 
93 
99  int extractMin(Type &min);
100 
102  void clear();
103 
105  int size() const;
106 
108  int number() const;
109 
111 
117  void realloc(int newSize);
118 
119 private:
120 
123 };
124 
125 }
126 
int number() const
Returns the number of elements stored in the priority queue.
Base class of all other classes of ABACUS.
Definition: abacusroot.h:68
int getMin(Type &min) const
Retrieves the element with minimal key from the priority queue.
int extractMin(Type &min)
Retrieves and removes the minimal element from the priority queue.
AbaPrioQueue(int size)
The constructor of an empty priority queue.
AbaBHeap< Type, Key > heap_
The heap implementing the priority queue.
Definition: bprioqueue.h:122
int size() const
Returns the maximal number of elements which can be stored in the priority queue. ...
void clear()
Makes the priority queue empty.
int getMinKey(Key &minKey) const
Retrieves the key of the minimal element in the priority queue.
void insert(Type elem, Key key)
Inserts an element in the priority queue.
Bounded priority queues.
Definition: bprioqueue.h:57
Binary heaps.
Definition: bheap.h:38
void realloc(int newSize)
Increases the size of the priority queue.