diff options
| author | Maksymilian Jopek <maks@jopek.eu> | 2023-03-26 15:53:00 +0200 |
|---|---|---|
| committer | Maksymilian Jopek <maks@jopek.eu> | 2023-03-26 17:37:35 +0200 |
| commit | 5a2665c21b511ef90967af053f6a1d504b78afff (patch) | |
| tree | 12b6727b0f1742132063eed1927b98c81f7352b1 /src/queue.h | |
| download | cstructures-5a2665c21b511ef90967af053f6a1d504b78afff.tar.gz cstructures-5a2665c21b511ef90967af053f6a1d504b78afff.tar.zst cstructures-5a2665c21b511ef90967af053f6a1d504b78afff.zip | |
Stack, queue and graph data structures implemented in C using linked lists.
Diffstat (limited to 'src/queue.h')
| -rw-r--r-- | src/queue.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/queue.h b/src/queue.h new file mode 100644 index 0000000..0082bda --- /dev/null +++ b/src/queue.h @@ -0,0 +1,20 @@ +#ifndef QUEUE_H_ +#define QUEUE_H_ + +struct queue { + struct queueItem *first; + struct queueItem *last; +}; +typedef struct queue Queue; +struct queueItem { + int item; + struct queueItem *next; + struct queueItem *previous; +}; + +Queue *queueAlloc(); +void queueAdd(Queue *queue, int item); +int queuePop(Queue *queue); +void queueFree(Queue *queue); + +#endif |
