graph

unidirected graph implementation using adjacency list
Index Commits Files Refs README LICENSE
queue.h (452B)
   1 #ifndef QUEUE_H_
   2 #define QUEUE_H_
   3 
   4 #include <stddef.h>
   5 #include <stdbool.h>
   6 
   7 typedef struct Node Node;
   8 typedef struct Queue Queue;
   9 
  10 struct Node {
  11     void *data;
  12     Node *next;
  13     Node *prev;
  14 };
  15 
  16 struct Queue {
  17     size_t type_size;
  18     Node *first;
  19     Node *end;
  20 };
  21 
  22 void queue_new(Queue **Q, size_t type_size);
  23 void queue_enqueue(Queue *Q, void *data);
  24 void queue_dequeue(Queue *Q, void *data);
  25 void queue_destroy(Queue *Q);
  26 
  27 bool queue_is_empty(Queue *Q);
  28 
  29 #endif