A stack of integer elements is implemented as an array. The index of the top element is
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 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?
Fantastic news! We've Found the answer you've been seeking!
Step by Step Answer:
Related Book For
C++ Plus Data Structures
ISBN: 9781284089189
6th Edition
Authors: Nell Dale, Chip Weems, Tim Richards
Question Posted: