FibonacciHeap #

new FibonacciHeap() #

Creates a new instance of a Fibonacci Heap.

fibonacciHeap.insert() #

Inserts a new data element into the heap. No heap consolidation is performed at this time, the new node is simply inserted into the root list of this heap. Running time: O(1) actual.

Kind: instance method of [FibonacciHeap](#FibonacciHeap)

fibonacciHeap.size() #

Returns the number of nodes in heap. Running time: O(1) actual.

Kind: instance method of [FibonacciHeap](#FibonacciHeap)

fibonacciHeap.clear() #

Removes all elements from this heap.

Kind: instance method of [FibonacciHeap](#FibonacciHeap)

fibonacciHeap.isEmpty() #

Returns true if the heap is empty, otherwise false.

Kind: instance method of [FibonacciHeap](#FibonacciHeap)

fibonacciHeap.extractMinimum() #

Extracts the node with minimum key from heap. Amortized running time: O(log n).

Kind: instance method of [FibonacciHeap](#FibonacciHeap)

fibonacciHeap.remove() #

Removes a node from the heap given the reference to the node. The trees in the heap will be consolidated, if necessary. This operation may fail to remove the correct element if there are nodes with key value -Infinity. Running time: O(log n) amortized.

Kind: instance method of [FibonacciHeap](#FibonacciHeap)

FibonacciHeap._decreaseKey() #

Decreases the key value for a heap node, given the new value to take on. The structure of the heap may be changed and will not be consolidated. Running time: O(1) amortized.

Kind: static method of [FibonacciHeap](#FibonacciHeap)

FibonacciHeap._cut() #

The reverse of the link operation: removes node from the child list of parent. This method assumes that min is non-null. Running time: O(1).

Kind: static method of [FibonacciHeap](#FibonacciHeap)

FibonacciHeap._cascadingCut() #

Performs a cascading cut operation. This cuts node from its parent and then does the same for its parent, and so on up the tree. Running time: O(log n); O(1) excluding the recursion.

Kind: static method of [FibonacciHeap](#FibonacciHeap)

FibonacciHeap._linkNodes() #

Make the first node a child of the second one. Running time: O(1) actual.

Kind: static method of [FibonacciHeap](#FibonacciHeap)

Fork me on GitHub