commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From simonetrip...@apache.org
Subject svn commit: r1144084 - /commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/collections/FibonacciHeap.java
Date Thu, 07 Jul 2011 22:38:47 GMT
Author: simonetripodi
Date: Thu Jul  7 22:38:47 2011
New Revision: 1144084

URL: http://svn.apache.org/viewvc?rev=1144084&view=rev
Log:
in FibonacciHeaps, root list is circular

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=1144084&r1=1144083&r2=1144084&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 Jul  7 22:38:47 2011
@@ -72,7 +72,10 @@ public final class FibonacciHeap<E>
         }
         else
         {
-            root.setPrevious( node );
+            node.setPrevious( root );
+            node.setNext( root.getNext() );
+            root.setNext( node );
+            node.getNext().setPrevious( root );
 
             int comparison;
             if ( comparator != null )



Mime
View raw message