You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Christian Decker
04f139f092
|
4 years ago | |
---|---|---|
.. | ||
LICENSE | 4 years ago | |
Makefile | 4 years ago | |
README | 4 years ago | |
galgorithm.h | 4 years ago | |
galgorithm.hpp | 4 years ago | |
gheap.h | 4 years ago | |
gheap.hpp | 4 years ago | |
gheap_cpp03.hpp | 4 years ago | |
gheap_cpp11.hpp | 4 years ago | |
gpriority_queue.h | 4 years ago | |
gpriority_queue.hpp | 4 years ago | |
ops_count_test.cpp | 4 years ago | |
perftests.c | 4 years ago | |
perftests.cpp | 4 years ago | |
tests.c | 4 years ago | |
tests.cpp | 4 years ago |
README
Generalized heap implementation
Generalized heap is based on usual heap data structure -
http://en.wikipedia.org/wiki/Heap_%28data_structure%29 .
It provides two additional paremeters, which allow optimizing heap
for particular cases:
* Fanout. The number of children per each heap node.
* Fanout=1 corresponds to sorted List data structure.
See http://en.wikipedia.org/wiki/List_%28computing%29 .
* Fanout=2 corresponds to Binary heap.
See http://en.wikipedia.org/wiki/Binary_heap .
* Fanout>2 corresponds to D-heap. See http://en.wikipedia.org/wiki/D-heap .
D-heap can be faster than Binary heap in the following cases:
* If item comparison is faster than item assignment.
* If sequential access to items is faster than non-sequential access
to items.
* If the number of 'decrease key' operations is larger than the number
of 'pop heap' operations for min-heap. This is usually the case
for Dijkstra algorithm
( http://en.wikipedia.org/wiki/Dijkstra%27s_algorithm )