Azinix

heap.h File Reference

Heap code. More...

#include "util.h"
#include "array.h"

Go to the source code of this file.

Data Structures

struct  Heap_t
 Heap data structure. More...

Typedefs

typedef Heap_t Heap_t

Functions

Heap_tHeap_Init (int(*)(char *, char *))
 Create a heap with 0 entries.
Heap_tHeap_InitN (int(*)(char *, char *), int n)
 Create a heap with N entries.
void Heap_Insert (Heap_t *, char *)
 Insert an entry into a heap.
int Heap_Size (Heap_t *)
 Returns the number of elements in the heap.
char * Heap_ReadMax (Heap_t *)
 Return the max element of the heap; does not change heap.
void Heap_Heapify (Heap_t *)
 Take a heap which satisfies the heap property everywhere but possibly the root, and make it into a heap.


Detailed Description

Heap code.

Definition in file heap.h.


Typedef Documentation

typedef struct Heap_t Heap_t

Definition at line 30 of file heap.h.


Function Documentation

void Heap_Heapify ( Heap_t  ) 

Take a heap which satisfies the heap property everywhere but possibly the root, and make it into a heap.

Definition at line 159 of file heap.c.

Heap_t* Heap_Init ( int(*)(char *, char *)   ) 

Create a heap with 0 entries.

AutomaticStart

Definition at line 81 of file heap.c.

Heap_t* Heap_InitN ( int(*)(char *, char *)  ,
int  n 
)

Create a heap with N entries.

Definition at line 65 of file heap.c.

void Heap_Insert ( Heap_t ,
char *   
)

Insert an entry into a heap.

Definition at line 92 of file heap.c.

char* Heap_ReadMax ( Heap_t  ) 

Return the max element of the heap; does not change heap.

Definition at line 142 of file heap.c.

int Heap_Size ( Heap_t  ) 

Returns the number of elements in the heap.

Definition at line 131 of file heap.c.