From 2af9351db3aa97da9b0d3f23d53a593bc96c8a8e Mon Sep 17 00:00:00 2001 From: Jaron Kent-Dobias Date: Fri, 2 Feb 2018 18:33:22 -0500 Subject: does potts now, no external libraries --- lib/queue.c | 50 -------------------------------------------------- 1 file changed, 50 deletions(-) delete mode 100644 lib/queue.c (limited to 'lib/queue.c') diff --git a/lib/queue.c b/lib/queue.c deleted file mode 100644 index 0823518..0000000 --- a/lib/queue.c +++ /dev/null @@ -1,50 +0,0 @@ - -#include "queue.h" - -void stack_push(ll_t **q, uint32_t x) { - ll_t *nq = malloc(sizeof(ll_t)); - nq->x = x; - nq->next = *q; - - *q = nq; -} - -void stack_push_d(dll_t **q, double x) { - dll_t *nq = malloc(sizeof(dll_t)); - nq->x = x; - nq->next = *q; - - *q = nq; -} - -uint32_t stack_pop(ll_t **q) { - ll_t *old_q = *q; - - *q = old_q->next; - uint32_t x = old_q->x; - - free(old_q); - - return x; -} - -double stack_pop_d(dll_t **q) { - dll_t *old_q = *q; - - *q = old_q->next; - double x = old_q->x; - - free(old_q); - - return x; -} - -bool stack_contains(const ll_t *q, uint32_t x) { - if (q == NULL) { - return false; - } else if (q->x == x) { - return true; - } else { - return stack_contains(q->next, x); - } -} -- cgit v1.2.3-70-g09d2