MCPcopy Create free account
hub / github.com/algorithm-archivists/algorithm-archive / dequeue

Function dequeue

contents/tree_traversal/code/c/utility.h:92–101  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

90}
91
92void *dequeue(struct queue *q) {
93 if (queue_empty(q)) {
94 return NULL;
95 }
96
97 void *ret = q->data[q->front];
98 q->front = (q->front + 1) % q->capacity;
99
100 return ret;
101}
102
103void free_queue(struct queue q) {
104 free(q.data);

Callers 1

bfs_queueFunction · 0.70

Calls 1

queue_emptyFunction · 0.70

Tested by

no test coverage detected