From d7652744c5cdfae218d8688faa48343c49d95de5 Mon Sep 17 00:00:00 2001
From: jonas <jonas.stirnemann@etu.hesge.ch>
Date: Mon, 6 Dec 2021 13:06:43 +0100
Subject: [PATCH] Added is_empty

---
 stack.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/stack.c b/stack.c
index fc4205b..0c1c9ee 100644
--- a/stack.c
+++ b/stack.c
@@ -1,4 +1,5 @@
 #include <stdlib.h>
+#include <stdbool.h>
 #include "stack.h"
 
 
@@ -75,3 +76,13 @@ int get_length(stack s) {
     return s.top + 1;
 }
 
+/**
+ * @brief Check if a stack is empty
+ * 
+ * @param s
+ * @return bool - true if stack is empty, false otherwise
+ */
+bool stack_is_empty(stack s)
+{
+    return s.top == -1;
+}
\ No newline at end of file
-- 
GitLab