Author: simonetripodi
Date: Thu Jun 28 12:10:48 2012
New Revision: 1354967
URL: http://svn.apache.org/viewvc?rev=1354967&view=rev
Log:
added more link() javadoc
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=1354967&r1=1354966&r2=1354967&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 12:10:48 2012
@@ -440,21 +440,26 @@ public final class FibonacciHeap<E>
/**
* Implements the {@code FIB-HEAP-LINK(H, y, x)} function.
*
+ * <pre>FIB-HEAP-LINK(H, y, x)
+ * 1 remove y from the root list of H
+ * 2 make y a child of x, incrementing degree[x]
+ * 3 mark[y] FALSE</pre>
+ *
* @param y the node has to be removed from the root list
* @param x the node has to to become fater of {@code y}
*/
private void link( FibonacciHeapNode<E> y, FibonacciHeapNode<E> x )
{
- // remove y from the root list of H
+ // 1 remove y from the root list of H
y.getLeft().setRight( y.getRight() );
y.getRight().setLeft( y.getLeft() );
- // make y a child of x, incrementing degree[x]
+ // 2 make y a child of x, incrementing degree[x]
x.setChild( y );
y.setParent( x );
x.incraeseDegree();
- // mark[y] <- FALSE
+ // 3 mark[y] <- FALSE
y.setMarked( false );
trees--;