Question: java Question 1 (1 point) Suppose you want to implement a Stack for a specific task. This task involves pushing 100,000 elements at the start.
Question 1 (1 point) Suppose you want to implement a Stack for a specific task. This task involves pushing 100,000 elements at the start. After this initialization, all push operations will be preceded by at least one pop. Which of the following data structures is the best choice to minimize the number of steps and memory use? O a) a Doubly-linked list, assuming you have fields referring to both the head and the tail Ob) It is not possible to implement a Stack with any of these methods c) a Singly-linked list, assuming you implement the Stack with addFirst() and removeFirst) d) an ArrayList, assuming you can initialize the underlying array to the length of your choice
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
