aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorymherklotz <ymherklotz@gmail.com>2016-12-09 22:48:28 +0000
committerymherklotz <ymherklotz@gmail.com>2016-12-09 22:48:28 +0000
commit0c5b64e10694bddf1f5eb904fcd64c4aac81a8a5 (patch)
tree6bb2dcdf2ebdd41cec9b7eeb8ab0de36c13e1be9 /include
parentdba9dfca366570496d0b5e0bdf60621a6b0ff804 (diff)
downloadA-star-algorithm-0c5b64e10694bddf1f5eb904fcd64c4aac81a8a5.tar.gz
A-star-algorithm-0c5b64e10694bddf1f5eb904fcd64c4aac81a8a5.zip
annotated priority_queue.hpp
Diffstat (limited to 'include')
-rw-r--r--include/astar.hpp1
-rw-r--r--include/priority_queue.hpp6
2 files changed, 7 insertions, 0 deletions
diff --git a/include/astar.hpp b/include/astar.hpp
index d40b97f..9dde48f 100644
--- a/include/astar.hpp
+++ b/include/astar.hpp
@@ -10,6 +10,7 @@
// TODO add constructors and functions to calculate heuristics etc..
class AStar {
public:
+ AStar();
private:
};
diff --git a/include/priority_queue.hpp b/include/priority_queue.hpp
index 5d8b5df..fe53335 100644
--- a/include/priority_queue.hpp
+++ b/include/priority_queue.hpp
@@ -6,7 +6,9 @@
template<typename T>
class PriorityQueue {
public:
+ // creates a new object of type T
PriorityQueue();
+ // deletes the array priority_array so that there are no memory leaks
~PriorityQueue();
// pushes element to the queue which is sorted by smallest element first
@@ -23,10 +25,14 @@ private:
// array that will represent the priority queue
T *priority_array;
+ // resize the queue's array accordingly by some factor
void resize_queue(double factor);
+ // insert and element into the queue
+ // this assumes that the capacity is larger than the size
void insert_queue(const T& element, const unsigned int& loc);
+ // removes an element from the queue
T remove_queue(const unsigned int& loc);
};