civquest.util
Class FibonacciHeap

java.lang.Object
  extended bycivquest.util.FibonacciHeap

public class FibonacciHeap
extends java.lang.Object

Implements a fibonacci-heap.


Constructor Summary
FibonacciHeap(java.util.Comparator comparator)
          Constructs a FibonacciHeap
 
Method Summary
 java.lang.Object getMinValue()
          Returns the smallest value in the whole heap
 void insert(java.lang.Object value)
          Inserts the given value into the heap.
static void main(java.lang.String[] argv)
          Included for testing FibonacciHeap
 java.lang.Object removeMinValue()
          Removes the smallest value from the heap.
 int size()
          Returns the number of values in the heap
 java.lang.String toString()
          Outputs the heap for debugging
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FibonacciHeap

public FibonacciHeap(java.util.Comparator comparator)
Constructs a FibonacciHeap

Parameters:
comparator - will be used for comparing the values
Method Detail

size

public int size()
Returns the number of values in the heap

Returns:
the number of values in the heap

getMinValue

public java.lang.Object getMinValue()
Returns the smallest value in the whole heap

Returns:
smallest heap-value

insert

public void insert(java.lang.Object value)
Inserts the given value into the heap. Note that you can only insert values you can compare with the heaps comparator.

Parameters:
value - a value as described

removeMinValue

public java.lang.Object removeMinValue()
Removes the smallest value from the heap.

Returns:
the removed value

toString

public java.lang.String toString()
Outputs the heap for debugging


main

public static void main(java.lang.String[] argv)
Included for testing FibonacciHeap