7.2. igraph_heap_init_array — Build a heap from an array.

int igraph_heap_init_array(igraph_heap_t *h, igraph_real_t* data, long int len);

Initializes a heap object from an array, the heap is also built of course (constructor).

Arguments: 

h:

Pointer to an uninitialized heap object.

data:

Pointer to an array of base data type.

len:

The length of the array at data.

Returns: 

Error code.

Time complexity: O(n), the number of elements in the heap.