diff --git a/lemon/pairing_heap.h b/lemon/pairing_heap.h --- a/lemon/pairing_heap.h +++ b/lemon/pairing_heap.h @@ -266,6 +266,8 @@ minimum = container[minimum].child; } + if (minimum >= 0) container[minimum].left_child = false; + --num_items; } diff --git a/test/heap_test.cc b/test/heap_test.cc --- a/test/heap_test.cc +++ b/test/heap_test.cc @@ -222,16 +222,16 @@ } // PairingHeap -// { -// typedef PairingHeap IntHeap; -// checkConcept, IntHeap>(); -// heapSortTest(); -// heapIncreaseTest(); -// -// typedef PairingHeap NodeHeap; -// checkConcept, NodeHeap>(); -// dijkstraHeapTest(digraph, length, source); -// } + { + typedef PairingHeap IntHeap; + checkConcept, IntHeap>(); + heapSortTest(); + heapIncreaseTest(); + + typedef PairingHeap NodeHeap; + checkConcept, NodeHeap>(); + dijkstraHeapTest(digraph, length, source); + } // RadixHeap {