#include #include #define SZ 7 int queue[SZ]; int front = 0; int rear = 0; int isEmpty() { return (rear == front); } int isFull() { return ((rear + 1) % SZ == front); } int deque() { if (isEmpty() == 1) { return -999; } int temp = queue[front]; front = (front + 1) % SZ; return temp; } void enque(int n) { int if100 = 0; if (isFull() == 1) { return; } if (n == 100) { while (isEmpty() == 0) { if100..
#include #include #define SZ 100 int stack[SZ]; int top = -1; int isEmpty() { return (top == -1); } int isFull() { return (top == (SZ - 1)); } int pop() { if (isEmpty() == 1) { return -999; } int temp; temp = stack[top--]; return temp; } void push(int n) { int if100 = 0; int popped = 0; if (isFull() == 1) { return; } if (n == 100) { while (isEmpty() == 0) { popped = pop(); if100 = if100 + popped..
#include #include #define SZ 5 int stack[SZ]; int top = -1; int isEmpty() { return (top == -1); } int isFull() { return (top == (SZ - 1)); } void push(int n) { if (isFull() == 1) { return; } stack[++top] = n; return; } int pop() { if (isEmpty() == 1) { return -999; } int temp; temp = stack[top--]; return temp; } int main(void) { int n, data; scanf("%d", &n); for (int i = 0; i < n; i++) { scanf("..