-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathutils.h
More file actions
57 lines (48 loc) · 973 Bytes
/
utils.h
File metadata and controls
57 lines (48 loc) · 973 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
/**
*
*/
void pqEnqueue(PriorityQueue *pq, int node, PRIORITY_DATA_TYPE priority)
{
priorityQueueEnqueue(pq, linkedListNodeCreate(node, priority));
}
/**
*
*/
LinkedListNode *pqPeek(PriorityQueue *pq)
{
return priorityQueuePeek(pq);
}
/**
*
*/
LinkedListNode *pqGet(PriorityQueue *pq, int position)
{
return priorityQueueGet(pq, position);
}
/**
*
*/
PRIORITY_DATA_TYPE pqDequeue(PriorityQueue *pq)
{
LinkedListNode *a = priorityQueueDequeue(pq);
PRIORITY_DATA_TYPE priority = a->priority;
free(a);
return priority;
}
void displayAdjacencyMatrix(Graph *graph)
{
int lenght = graphLenght(graph);
for (int i = 0; i < lenght; i++)
{
for (int j = 0; j < lenght; j++)
{
if (!graphValidPosition(graph, i, j))
{
printf(" - ");
continue;
}
printf("%2d ", graphGetEdgeWeight(graph, i, j));
}
printf("\n");
}
}