Professional Documents
Culture Documents
Assignment
Submitted To
Md. Al-Mamun Riyadh
Lecturer, Dept. of CSE
City University
Submitted By
Rabbany Rahman
2015302501
Program:
// Design a stack data structure with following functions Empty, Size, Top,
Push, Pop, Display.
#include <stdio.h>
#include<stdlib.h>
typedef struct Node node;
struct Node{
int value;
node *next;
};
int main(){
node* head=NULL;
head=push(head,1);
head=push(head,2);
head=push(head,3);
head=push(head,4);
display(head);
head=pop(head);
display(head);
printf("empty: %d\n",empty(head));
printf("Size: %d\n",size(head));
printf("Top: %d\n",top(head));
return 0;
}
Output: