Question: Data structures: java 7. Suppose we implement a stack using a partially-filled array. What is wrong with storing the top-of-stack at location [0] and the
Data structures: java

7. Suppose we implement a stack using a partially-filled array. What is wrong with storing the top-of-stack at location [0] and the bottom of the stack at the last used position of the array? 8. If we use a linked list with a head and a tail reference to implement a stack, which is better and why? Having the top-of-stack at the head of the linked list, or having the top-of-stack at the tail of the linked list?
Step by Step Solution
3.33 Rating (150 Votes )
There are 3 Steps involved in it
Answer 7 If the array is partially filled and we have put topOfSt... View full answer
Get step-by-step solutions from verified subject matter experts
