Seguinte: priorqueue.c
Acima: Códigos-fonte: Solução por heurística
Anterior: main.c
001 #ifndef __PRIORQUEUE_H
002 #define __PRIORQUEUE_H
003
004
005
006
007
008
009 typedef struct {
010
011
012
013
014 int (* Compare)(void *pq, int nIndex1, int nIndex2);
015
016
017
018 int (* CompareKey)(void *pq, int nIndex, int nKey);
019
020
021 int (* GetId)(void *pq, int nIndex);
022
023
024
025 void (* QueueIndexChanged)(void *pq, int nIndex);
026
027
028 void (* SetKey)(void *pq, int nIndex, int nKey);
029
030
031
032 void (* Swap)(void *pq, int nIndex1, int nIndex2);
033
034
035 int nElems;
036 } TPriorityQueueControl;
037
038
039 void PriorQueueMinHeapify(void *pq, TPriorityQueueControl *pqc, int nIndex);
040 void PriorQueueBuildMinHeap(void *pq, TPriorityQueueControl *pqc);
041 int PriorQueueExtractMin(void *pq, TPriorityQueueControl *pqc);
042 void PriorQueueDecreaseKey(void *pq, TPriorityQueueControl *pqc, int nIndex,
043 int nNovaDist);
044
045
046 #endif
Seguinte: priorqueue.c
Acima: Códigos-fonte: Solução por heurística
Anterior: main.c
VilarNt
2003-06-20