Author: simonetripodi
Date: Thu Jun 28 11:44:20 2012
New Revision: 1354952
URL: http://svn.apache.org/viewvc?rev=1354952&view=rev
Log:
added javadoc comment to the insert() method
Modified:
commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/collections/FibonacciHeap.java
Modified:
commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/collections/FibonacciHeap.java
URL:
http://svn.apache.org/viewvc/commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/collections/FibonacciHeap.java?rev=1354952&r1=1354951&r2=1354952&view=diff
==============================================================================
---
commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/collections/FibonacciHeap.java
(original)
+++
commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/collections/FibonacciHeap.java
Thu Jun 28 11:44:20 2012
@@ -113,13 +113,6 @@ public final class FibonacciHeap<E>
throw new NullPointerException();
}
- // FIB-HEAP-INSERT(H, x)
-
- // p[x] <- NIL
- // child[x] <- NIL
- // left[x] <- x
- // right[x] <- x
- // mark[x] <- FALSE
insert( new FibonacciHeapNode<E>( e ) );
elementsIndex.add( e );
@@ -551,6 +544,18 @@ public final class FibonacciHeap<E>
/**
* Adds a node in the current structure.
*
+ * <pre>FIB-HEAP-INSERT(H, x)
+ * 1 degree[x] <- 0
+ * 2 p[x] <- NIL
+ * 3 child[x] <- NIL
+ * 4 left[x] <- x
+ * 5 right[x] <- x
+ * 6 mark[x] <- FALSE
+ * 7 concatenate the root list containing x with root list H
+ * 8 if min[H] = NIL or key[x] < key[min[H]]
+ * 9 then min[H] <- x
+ * 10 n[H] <- n[H] + 1</pre>
+ *
* @param node the node has to be added.
* @see #offer(Object)
* @see #add(Object)