Professional Documents
Culture Documents
Fourth Semester Department of Electrical Engineering
Fourth Semester Department of Electrical Engineering
Research Faisalabad
push(3);
data = pop();
Task#2
Write a function for push operation.
C Function:
stack->array[++stack->top] = item;
printf("%d pushed to stack\n", item);
}
Task#3
Write a function for pop operation.
C Function:
Task#4
Write a function for displaying a stack.
C Function:
while(!isempty()) {
data = pop();
printf("%d\n",data);
}
}
Conclusion:
In this lab, I came to know the basic steps for the implementation of
different types of operations on stacks and their use as well as working such as Pop, Push
operation etc.