Professional Documents
Culture Documents
int data;
push(3);
data = pop();
}
Task 2:
{
if (isFull(stack)) {
return;
}
stack->array[++stack->top] = item;
printf("%d pushed to stack\n", item);
}
Task 3:
return stack->array[stack->top--];
Task 4:
Write a function for displaying a stack.
int data;
while(!isempty()) {
data = pop();
printf("%d\n",data);
Conclusion:
From this lab, I learned the basic steps for the implementation of the
different types of operations on stacks and also about their use as well as working
such as:
Pop Operation
Push operation etc.