You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by si...@apache.org on 2012/06/28 13:44:23 UTC

svn commit: r1354952 - /commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/collections/FibonacciHeap.java

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] &lt;- 0
+     * 2  p[x] &lt;- NIL
+     * 3  child[x] &lt;- NIL
+     * 4  left[x] &lt;- x
+     * 5  right[x] &lt;- x
+     * 6  mark[x] &lt;- FALSE
+     * 7  concatenate the root list containing x with root list H
+     * 8  if min[H] = NIL or key[x] &lt; key[min[H]]
+     * 9     then min[H] &lt;- x
+     * 10  n[H] &lt;- n[H] + 1</pre>
+     *
      * @param node the node has to be added.
      * @see #offer(Object)
      * @see #add(Object)