massspec/heap.h
00001 #ifndef _HEAP_H_
00002 #define _HEAP_H_
00003
00004
00005
00006
00007
00008
00009 typedef struct
00010 {
00011 void* node;
00012 int(*cmp)(void *node1, void *node2);
00013 int tail;
00014 int size;
00015 int sof;
00016 char name[12];
00017 } Heap;
00018
00019 void createHeap(Heap* H, char* name, int size_of_heap, int size_of_element, int(*cmp_function)(void* node1, void* node2));
00020 void insertHeap(Heap* H, void* newNode);
00021 int heapifyUp(Heap *H, int pos);
00022 int maxChild(Heap *H, int left, int right);
00023 int heapifyDown(Heap *H, int pos);
00024 void extractMax(Heap *H, void* max);
00025
00026 void printHeap(Heap *H);
00027
00028 #endif
00029
Generated on Sun Feb 13 01:05:57 2005 for MapQuant by
1.3.7