a44421a79fb36cc2036fe116b97ea3bc9590cd0c braney Fri Dec 2 09:34:39 2011 -0800 removed rcsid (#295) diff --git src/lib/quickHeap.c src/lib/quickHeap.c index 3246781..eec8fe2 100644 --- src/lib/quickHeap.c +++ src/lib/quickHeap.c @@ -15,31 +15,30 @@ * children(n) == 2n+1,2n+2. parent(n) == (n-1)/2. * The highest score is always at the top of the heap in * position 0. When the top element is consumed and * and the next element for the previously top elem is * set in, we simply balance the heap to maintain the heap property * by swapping with the largest child until both children * are smaller, or we hit the end of the array (==heapCount). * Also note that scores are not necessarily unique, heap members * may have equal score. So A parent need not only be greater * than its children, it may also be equal to them. */ #include "common.h" #include "quickHeap.h" -static char const rcsid[] = "$Id: quickHeap.c,v 1.1 2005/10/21 05:36:08 galt Exp $"; struct quickHeap *newQuickHeap(int initSize, int (*compare )(const void *elem1, const void *elem2)) /* Create a new array quick heap of initial size specified, * The compare function must return > 0 if elem1 > elem2, etc.*/ { struct quickHeap *h; if (initSize < 1) errAbort("invalid initial size for newQuickHeap: %d",initSize); AllocVar(h); h->heapCount=0; h->heapMax = initSize; h->heap = AllocN(void *,h->heapMax); h->compareFunc = compare;