129k views
2 votes
Implement a function with signature transfer(S, T) that transfers all elements from stack S onto stack T, so that the element that starts at the top

of S is the first to be inserted onto T, and the element at the bottom of S
ends up at the top of T.

User C Deepak
by
5.2k points

1 Answer

2 votes
I’ve took engineering but never learnt this lol
User Mark Stickley
by
5.4k points