C Everything
This is a C repository containing a curated set of generic data structures and algorithm.
|
Contains definitions of routines supported by heap. More...
#include "heap.h"
Go to the source code of this file.
Functions | |
void | heap_insert (t_gen d, t_gen data) |
Insert an element to heap More... | |
t_gen | heap_extract_root (t_gen d) |
Extract the root from heap More... | |
void | heap_build (t_gen d) |
Build a heap given a array More... | |
void | heap_sort (t_gen d) |
Heap sort the data More... | |
int | heap_len (t_gen h) |
heap count More... | |
void | heap_print (t_gen d) |
heap_print_info More... | |
bool | heap_empty (t_gen d) |
To check if heap empty More... | |
bool | heap_full (t_gen d) |
To check if heap full More... | |
t_gen | heap_update_key (t_gen d, t_gen val, int idx) |
heap update value of given node More... | |
void | destroy_heap (t_gen d) |
Destroy the instance of the heap More... | |
t_gen | create_heap (char *name, t_gen data, int size, e_heaptype htype, t_dparams *prm) |
Create an instance of heap More... | |
void | heapify_up (t_heap *h, int idx) |
Preserve heap property on insert by heapifying from bottom to root More... | |
void | heapify (t_heap *h, int idx) |
Rearrange a heap to maintain the heap property aka heapyfy_down More... | |
char * | get_heaptype_name (e_heaptype type) |
Contains definitions of routines supported by heap.
Definition in file heap.c.
t_gen create_heap | ( | char * | name, |
t_gen | data, | ||
int | size, | ||
e_heaptype | htype, | ||
t_dparams * | prm | ||
) |
void destroy_heap | ( | t_gen | d | ) |
char* get_heaptype_name | ( | e_heaptype | type | ) |
void heap_build | ( | t_gen | d | ) |
bool heap_empty | ( | t_gen | d | ) |
bool heap_full | ( | t_gen | d | ) |
int heap_len | ( | t_gen | h | ) |
void heap_print | ( | t_gen | d | ) |
void heap_sort | ( | t_gen | d | ) |
void heapify | ( | t_heap * | h, |
int | idx | ||
) |