blob: 8c26f9f26ca196cda0bf428f0afc76bbfc4aaf8f [file] [log] [blame]
brians343bc112013-02-10 01:53:46 +00001#ifndef _BinHeap_H
2#define _BinHeap_H
3
4#include <stdint.h>
5
6typedef uint8_t ElementType;
7struct HeapStruct;
8typedef struct HeapStruct *PriorityQueue;
9
10struct HeapStruct
11{
12 int Capacity;
13 int Size;
14 ElementType *Elements;
15};
16
17// Elements is the number allocated at H->Elements
18void Initialize( int Elements, PriorityQueue H );
19// 0 if successful, -1 if full
20int Insert( ElementType X, PriorityQueue H );
21void Remove( ElementType X, PriorityQueue H );
22ElementType DeleteMin( PriorityQueue H );
23ElementType GetMin( PriorityQueue H );
24int IsEmpty( PriorityQueue H );
25int IsFull( PriorityQueue H );
26int GetSize( PriorityQueue H );
27
28#endif
29