This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void dyHeapRemoveMin(DynamicArray* heap, compareFunction compare) | |
{ | |
// FIXME: implement | |
int last = dySize(heap)-1; | |
assert (last != 0); /* make sure we have at least one element */ | |
/* Copy the last element to the first position */ | |
dyPut(heap, dyGet(heap, last), 0); | |
dyRemoveAt(heap, last); /* Remove last element.*/ | |
adjustHeap(heap, last, 0, compare);/* Rebuild heap */ | |
} |
NewerOlder