summaryrefslogtreecommitdiff
path: root/src/01/01b/stack.c
diff options
context:
space:
mode:
authormo khan <mo.khan@gmail.com>2020-07-05 14:01:59 -0600
committermo khan <mo.khan@gmail.com>2020-07-05 14:01:59 -0600
commit8bf32957fef23b85b1421c38b6416047bcba476e (patch)
tree3eece4d270f52c91a6c22e84b6eb636fd57326c1 /src/01/01b/stack.c
parente27441426cd127c1f9969da1fcd2fde0ab415586 (diff)
run make fmt
Diffstat (limited to 'src/01/01b/stack.c')
-rw-r--r--src/01/01b/stack.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/01/01b/stack.c b/src/01/01b/stack.c
index dfe3c05..5798b22 100644
--- a/src/01/01b/stack.c
+++ b/src/01/01b/stack.c
@@ -9,7 +9,7 @@ static int MAX_SIZE = 2147483647;
*
* @return A Queue struct
*/
-static Queue *newQueue(void){
+static Queue *newQueue(void) {
Queue *queue = malloc(sizeof(Queue));
queue->size = 0;
queue->head = NULL;
@@ -68,7 +68,8 @@ void enqueue(Queue *self, int data) {
* @return The data for the next it to remove from the Queue
*/
int dequeue(Queue *self) {
- if (self->head == NULL) return -1;
+ if (self->head == NULL)
+ return -1;
Node *node = self->head;
int data = node->data;
@@ -118,9 +119,7 @@ int pop(Stack *self) {
* @param self The stack to investigate
* @return The count of items on the stack.
*/
-int size(Stack *self) {
- return self->q1->size;
-}
+int size(Stack *self) { return self->q1->size; }
/**
* The equivalent of a destructor to free any memory associated with a Stack.