}
3.24 Two stacks can be implemented in an array by having one grow from the low end of the array up, and the
other from the high end down.
3.25 (a) Let E be our extended stack. We will implement E with two stacks. One stack, which we’ll call S, is used
to keep track of the push and pop operations, and the other M, keeps track of the minimum. To implement
3.26 Three stacks can be implemented by having one grow from the bottom up, another from the top down and a
third somewhere in the middle growing in some (arbitrary) direction. If the third stack collides with either of
the other two, it needs to be moved. A reasonable strategy is to move it so that its center (at the time of the
move) is halfway between the tops of the other two stacks.
3.27 Stack space will not run out because only 49 calls will be stacked. However, the running time is exponential,
as shown in Chapter 2, and thus the routine will not terminate in a reasonable amount of time.
3.28 Since the LinkedList class supports adding and removing from the first and end of the list, the Deque
class shown below simply wraps these operations.