Suppose you are given a stack S1, [3, 5, 1, 6, 7, 9]
(represented as top -> [3, 5, 1, 6, 7, 9] <- bottom), and you
pop all of its elements and transfer them to S2 and then call
pop() on S2 twice. What would be the result if peek() is
called on S2 next?
Suppose you are given a stack S1, [3, 5, 1, 6, 7, 9] (represented as top -> [3, 5, 1, 6, 7, 9] <- bottom), and you pop a
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am