Reversing a List Property 4
reverse of remaining stack [ x, [ ] ] and already reversed stack ys = [ x, ys ]
This property states that if the remaining list has just 1 element, then the reverse result is just the element prepended to the already reversed list.
Examples
reverse of remaining stack [ 7, [ ] ] and already reversed stack [ ] = [ 7, [ ] ]
reverse of remaining stack [ 3, [ ] ] and already reversed stack [ 37, [ ] ] = [ 3, [ 37, [ ] ] ]
reverse of remaining stack [ 5, [ ] ] and already reversed stack [ 17, [ 19, [ 21, [ ] ] ] ] = [ 5, [ 17, [ 19, [ 21, [ ] ] ] ] ]
reverse of remaining stack [ 4, [ ] ] and already reversed stack [ 3, [ 2, [ 1, [ ] ] ] ] = [ 4, [ 3, [ 2, [ 1, [ ] ] ] ] ]
Please fill in the blank:
(reverse of remaining list [1,[]] and already reversed list [2, [3,[4,[]]]]) = _______
Comments
Please log in to add comments