Quantcast
Channel: Programming Spark
Viewing all articles
Browse latest Browse all 25

C program to implement Queue using two Stacks

$
0
0
Here is the program to implement Queue using two Stacks #include #define max 5 // size of the Stack struct stack { int top,a[max]; }; int push(struct stack *p1,int n) { if(p1->top==max-1) // Condition for checking If Stack is Full { printf("stack overflow\n"); return 0; } p1->top++; //increment

Viewing all articles
Browse latest Browse all 25

Trending Articles