Template class for a Fibonacci Heap data structure.
More...
#include <FiboHeap.hpp>
template<typename Data, typename Key>
class FibonacciHeap< Data, Key >
Template class for a Fibonacci Heap data structure.
This class implements a Fibonacci heap data structure which is a min-heap of Fibonacci Nodes sorted by Key
See http://en.wikipedia.org/wiki/Fibonacci_heap and http://www.cse.yorku.ca/~aaw/Jason/FibonacciHeapAlgorithm.html for references.
template<typename Data , typename Key >
template<typename Data , typename Key >
template<typename Data , typename Key >
template<typename Data , typename Key >
Decrease the key of a node to a given value.
- Parameters
-
| node | a node of which key is to be decreased |
| newKey | the new key given to the node |
template<typename Data , typename Key >
Remove the minimum node of the heap, i.e. the Fibonacci Heap Extract Min procedure.
Phase 1: Make all the removed root's children new roots:
Phase 2-a: handle the case where we delete the last myKey:
Phase 2: merge roots with the same degree:
Phase 3: remove the current root, and calculate the new rootWithMinKey:
template<typename Data , typename Key >
Check if the heap is empty.
- Returns
- true if heap is empty, false otherwise
template<typename Data , typename Key >
Insert a node to the heap.
- Parameters
-
| d | data of the node to be added to the heap |
| k | value of the node to be added to the heap |
- Returns
- a pointer to the newly added node
template<typename Data , typename Key >
Insert a node to the heap.
- Parameters
-
| newNode | a pointer to the node to be added to the heap |
- Returns
- a pointer to the newly added node
template<typename Data , typename Key >
Fibonacci-Heap union procedure.
Merge a Fibonnacci heap with the current one.
- Parameters
-
| other | a second Fibonnacci heap to merge with the heap |
template<typename Data , typename Key >
Return the node associated with the minimum key.
- Returns
- the minimum Fibonnaci node of the heap
template<typename Data , typename Key >
Print the roots in an output stream.
- Parameters
-
template<typename Data , typename Key >
Remove a node from the heap.
- Parameters
-
| node | the node to remove from the heap |
| minusInfinity | a key lower to every other key in the heap |
template<typename Data , typename Key >
total number of elements in heap
template<typename Data , typename Key >
maximum degree (=child count) of a root in the circular d-list
template<typename Data , typename Key >
a circular d-list of nodes
The documentation for this class was generated from the following file:
- /home/johan/Documents/UNamur/VirtualBelgium/Workspace/VirtualBelgium/include/FiboHeap.hpp