Question: A stack of integer elements is implemented as an array. The index of the top element is kept in position 0 in the array, and
A stack of integer elements is implemented as an array. The index of the top element is kept in position 0 in the array, and the stack elements are stored in stack[1].. stack[stack[0]}.
1. How does this implementation fare when assessed against the idea of an array as a homogeneous collection of data elements?
2. How would this implementation change the stack specifications? How would it change the implementations of the functions?
Step by Step Solution
3.43 Rating (156 Votes )
There are 3 Steps involved in it
1 An array is said to be homogeneous when it contains elements of the same data type stored contiguo... View full answer
Get step-by-step solutions from verified subject matter experts
