0

How many stacks do we want if we need to swap 2 stacks members in the same order?

17th Jun 2017, 2:40 AM
Khaled Mohammed Saif Alselwi
Khaled Mohammed Saif Alselwi - avatar
2 ответов
+ 1
2 additional stacks. Stacks work on LIFO, assume you want to swap A & B. Move to all members of A to C and members of b to D. then move them C to B and D to A.
17th Jun 2017, 7:07 AM
Gurpreet Singh
Gurpreet Singh - avatar
0
yes totally correct....😄
22nd Jun 2017, 12:34 PM
Khaled Mohammed Saif Alselwi
Khaled Mohammed Saif Alselwi - avatar