Skip to content
Permalink
Browse files
added javadoc comment to the insert() method
  • Loading branch information
simonetripodi committed Jun 28, 2012
1 parent cb42a86 commit 98b71e06238c34b2eec748ae28b1856bb800794e
Showing 1 changed file with 12 additions and 7 deletions.
@@ -113,13 +113,6 @@ public boolean add( E 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 int potential()
/**
* 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)

0 comments on commit 98b71e0

Please sign in to comment.