Skip to content
Permalink
Browse files
added more link() javadoc
  • Loading branch information
simonetripodi committed Jun 28, 2012
1 parent 49e1d76 commit c556e2f91de29fc3085663bb97282a7b0a373090
Showing 1 changed file with 8 additions and 3 deletions.
@@ -440,21 +440,26 @@ private void consolidate()
/**
* 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--;

0 comments on commit c556e2f

Please sign in to comment.