A program that takes in a list of numbers onto a stack, then has to sort said stack using another stack. Essentially, you have 2 stacks to sort a list of numbers.
A limited number of operations are given
-
swap 2 elements on stack a
-
swap 2 elements on stack b
-
both the above at the same time
-
push element on top of stack a to top of stack b
-
push element on top of stack b to top of stack a
-
both the above at the same time
-
rotate stack a, first element becomes last
-
rotate stack b, first element becomes last
-
both the above at same time
-
reverse rotate stack a, last element becomes the first
-
reverse rotate stack b, last element becomes the first
-
both the above at the same time