In step 2, we state that the reverse of
[1, [2, [3, []]]]
is
[3,[2,[1,[]]]]
Then we prepend 4 to this list in step 3, which leads to:
[4,[3,[2,[1,[]]]]]
Then step 5 shows that the reverse of the above list is:
[1,[2,[3,[4,[]]]]]
Quiz (1 point)
- result of appending y to xs = reverse of [ y, reverse of xs ]
- reverse of [ 1, [ 2, [ 3, [ ] ] ] ] = [ 3, [ 2, [ 1, [ ] ] ] ]
- reverse of [ 4, [ 3, [ 2, [ 1, [ ] ] ] ] ] = [ 1, [ 2, [ 3, [ 4, [ ] ] ] ] ]
if reverse of [ 1, [ 2, [ 3, [ ] ] ] ] = [ 3, [ 2, [ 1, [ ] ] ] ], then [ 4, reverse of [ 1, [ 2, [ 3, [ ] ] ] ] ] = [ 4, [ 3, [ 2, [ 1, [ ] ] ] ] ]
if [ 4, reverse of [ 1, [ 2, [ 3, [ ] ] ] ] ] = [ 4, [ 3, [ 2, [ 1, [ ] ] ] ] ], then reverse of [ 4, reverse of [ 1, [ 2, [ 3, [ ] ] ] ] ] = reverse of [ 4, [ 3, [ 2, [ 1, [ ] ] ] ] ]
if the following are true:
- a = b
- b = c
then a = c
if the following are true:
- a = b
- b = c
then a = c
Please write your proof in the table below. Each row should contain one claim. The last claim is the statement that you are trying to prove.