![]() |
Virtual Belgium
2.0
A micro-simulation platform for the Belgian population
|
A template Fibonacci heap node class. More...
#include <FiboHeap.hpp>
Public Member Functions | |
| Key | key () const |
| Return node's key. More... | |
| Data | data () const |
| Return node's data. More... | |
Private Member Functions | |
| FibonacciHeapNode () | |
| Default constructor. More... | |
| FibonacciHeapNode (Data d, Key k) | |
| Constructor. More... | |
| bool | isSingle () const |
| Check if the node is single. More... | |
| void | insert (FibonacciHeapNode< Data, Key > *other) |
| Inserts a new node after this node. More... | |
| void | remove () |
| Removes the node from the list. More... | |
| void | addChild (FibonacciHeapNode< Data, Key > *other) |
| Add a child to the node. More... | |
| void | removeChild (FibonacciHeapNode< Data, Key > *other) |
| Remove a child node. More... | |
| void | printTree (ostream &out) const |
| Print the tree of nodes starting from the current one acting as the root. More... | |
| void | printAll (ostream &out) const |
| Print every tree of nodes on the same level as the current one. More... | |
Private Attributes | |
| Key | myKey |
| key associated to the node More... | |
| Data | myData |
| data stored in the node More... | |
| uint | degree |
| number of children. used in the deletemin algorithm. More... | |
| bool | mark |
| mark used in the decreaseKey algorithm. More... | |
| FibonacciHeapNode< Data, Key > * | previous |
| pointer to the previous node More... | |
| FibonacciHeapNode< Data, Key > * | next |
| pointer to the next node More... | |
| FibonacciHeapNode< Data, Key > * | child |
| pointer to the first child in the list of children More... | |
| FibonacciHeapNode< Data, Key > * | parent |
| pointer to the parent More... | |
Friends | |
| template<typename D , typename K > | |
| class | FibonacciHeap |
| ostream & | operator<< (ostream &out, const FibonacciHeapNode &n) |
| Overload of '<<'. More... | |
A template Fibonacci heap node class.
Nodes used by the Fibonacci heap data structure, implemented in a circular doubly linked list.
|
inlineprivate |
Default constructor.
|
inlineprivate |
Constructor.
| d | the data stored in the node |
| k | the key associated to data |
|
inlineprivate |
Add a child to the node.
Fibonacci-Heap-Link(other,current) operatation.
| other | a child node to link to the current one |
|
inline |
Return node's data.
|
inlineprivate |
Inserts a new node after this node.
For example: given 1->2->3->4->1, insert a->b->c->d->a after node 3: result: 1->2->3->a->b->c->d->4->1
|
inlineprivate |
Check if the node is single.
|
inline |
Return node's key.
|
inlineprivate |
Print every tree of nodes on the same level as the current one.
| out | an output stream |
|
inlineprivate |
Print the tree of nodes starting from the current one acting as the root.
| out | an output stream |
|
inlineprivate |
Removes the node from the list.
|
inlineprivate |
Remove a child node.
| other | a child node to remove from current one |
|
friend |
|
friend |
Overload of '<<'.
| out | an output stream |
| n | a Fibonacci node |
|
private |
pointer to the first child in the list of children
|
private |
number of children. used in the deletemin algorithm.
|
private |
mark used in the decreaseKey algorithm.
|
private |
data stored in the node
|
private |
key associated to the node
|
private |
pointer to the next node
|
private |
pointer to the parent
|
private |
pointer to the previous node