Function binheap_make

Function Documentation

status_t binheap_make(struct binheap *heap, const void *data, size_t n_elts)

Convert an unordered array into a heap (presumably after you have copied a bunch of data into the heap array, instead of adding elements one at a time). This is O(n), rather than than the O(nlogn) for adding each element one at a time.

Parameters:
  • heap – The heap handle.

  • data – A sequential array of data to turn into a heap.

  • n_elts – # of elements in the data array.

Returns:

status_t