diff --git a/linked_stack.c b/linked_stack.c new file mode 100644 index 0000000..a74a8aa --- /dev/null +++ b/linked_stack.c @@ -0,0 +1,35 @@ + +#include +#include +#include +#include "SinglyLinkedList.h" + +node* createstack() +{ +node *head=createhead(); +return head; +} + + + + +void push(int item,node *head) +{ + insertfirst(head,item); + +} + +int pop(node *head) +{ + return(deletefirst(head)); +} + + +int peek(node *head) +{ +if(head->link!=NULL) + return head->link->value; +else + return 0; +} +