# HG changeset patch # User Peter Kovacs # Date 2009-07-20 19:06:39 # Node ID 9314d9339475d4747dceb17b8f34d0bbc77d6b93 # Parent 39a5b48bcace4e67c679ae38cd9493203999171b Smarter bubbleDown() in K-ary heaps (#301) diff --git a/lemon/fourary_heap.h b/lemon/fourary_heap.h --- a/lemon/fourary_heap.h +++ b/lemon/fourary_heap.h @@ -131,29 +131,6 @@ return _comp(p1.second, p2.second); } - int findMin(const int child, const int length) { - int min=child; - if( child+30 && less(p,_data[par]) ) { @@ -167,14 +144,26 @@ void bubbleDown(int hole, Pair p, int length) { if( length>1 ) { int child = firstChild(hole); - while( child0 && less(p,_data[par]) ) { @@ -161,14 +151,29 @@ void bubbleDown(int hole, Pair p, int length) { if( length>1 ) { int child = firstChild(hole); - while( child