Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

Loading...
Searching...
No Matches
bprioqueue.h
Go to the documentation of this file.
1
31#pragma once
32
34
35#pragma GCC visibility push(default)
36namespace abacus {
37
39
57template<class Type, class Key>
58class AbaPrioQueue : public AbacusRoot {
59public:
60
62
67
69
73 void insert(Type elem, Key key);
74
76
82 int getMin(Type &min) const;
83
85
91 int getMinKey(Key &minKey) const;
92
94
100 int extractMin(Type &min);
101
103 void clear();
104
106 int size() const;
107
109 int number() const;
110
112
118 void realloc(int newSize);
119
120private:
121
124};
125
126}
127
129#pragma GCC visibility pop
Binary heaps.
Definition bheap.h:73
Bounded priority queues.
Definition bprioqueue.h:58
int number() const
Returns the number of elements stored in the priority queue.
int getMinKey(Key &minKey) const
Retrieves the key of the minimal element in the priority queue.
AbaPrioQueue(int size)
The constructor of an empty priority queue.
void realloc(int newSize)
Increases the size of the priority queue.
int extractMin(Type &min)
Retrieves and removes the minimal element from the priority queue.
void insert(Type elem, Key key)
Inserts an element in the priority queue.
int getMin(Type &min) const
Retrieves the element with minimal key from the priority queue.
int size() const
Returns the maximal number of elements which can be stored in the priority queue.
AbaBHeap< Type, Key > heap_
The heap implementing the priority queue.
Definition bprioqueue.h:123
void clear()
Makes the priority queue empty.
Base class of all other classes of ABACUS.
Definition abacusroot.h:69