Skip to content
Snippets Groups Projects

Resolve "Add is empty function"

Merged orestis.malaspin requested to merge 10-add-is-empty-function into main
2 files
+ 14
1
Compare changes
  • Side-by-side
  • Inline
Files
2
+ 13
0
#include <stdlib.h>
#include <stdbool.h>
#include <stdio.h>
#include "stack.h"
@@ -75,3 +78,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
Loading