C Everything
This is a C repository containing a curated set of generic data structures and algorithm.
heap.h File Reference

Contains declations of heap types, operations and structure. More...

#include "common.h"

Go to the source code of this file.

Data Structures

struct  heap
 Heap struct defn. More...
 

Typedefs

typedef t_gen(* f_update) (t_gen d, t_gen val, int idx)
 heapf update key fn defn More...
 
typedef struct heap t_heap
 Heap struct defn. More...
 

Enumerations

enum  e_heaptype { eMIN_HEAP , eMAX_HEAP }
 Types of heaps. More...
 

Functions

t_gen create_heap (char *name, t_gen data, int size, e_heaptype htype, t_dparams *prm)
 
Create an instance of heap More...
 

Detailed Description

Contains declations of heap types, operations and structure.

Definition in file heap.h.

Typedef Documentation

◆ f_update

typedef t_gen(* f_update) (t_gen d, t_gen val, int idx)

heapf update key fn defn

Definition at line 15 of file heap.h.

◆ t_heap

typedef struct heap t_heap

Heap struct defn.

Enumeration Type Documentation

◆ e_heaptype

enum e_heaptype

Types of heaps.

Enumerator
eMIN_HEAP 

Minimum Heap

eMAX_HEAP 

Maximum Heap.

Definition at line 9 of file heap.h.

Function Documentation

◆ create_heap()

t_gen create_heap ( char *  name,
t_gen  data,
int  size,
e_heaptype  htype,
t_dparams prm 
)


Create an instance of heap

Parameters
name- Name of heap instance
size- Max size of heap instance
type- Type of heap to be created
data- Array pointer to build heap
prm- Data type specific parameters
Returns
- Pointer to instance of heap

Definition at line 29 of file heap.c.