In this example, we prove that the maximum index of
[3,[2,[1,[]]]]
is 0.
First, we prove that the maximum value of
[3,[2,[1,[]]]]
is 3. Then we find the index of 3 in the same list. 3 is in index 0.
Quiz (1 point)
Prove that:
index of the maximum value in stack [ 3, [ 2, [ 1, [ ] ] ] ] = 0
The following properties may be helpful:
- index of the maximum value in stack els = index of value (maximum value in stack els) in els
- maximum value in stack [ 3, [ 2, [ 1, [ ] ] ] ] = 3
- index of value 3 in [ 3, [ 2, [ 1, [ ] ] ] ] = 0
if maximum value in stack [ 3, [ 2, [ 1, [ ] ] ] ] = 3, then index of value (maximum value in stack [ 3, [ 2, [ 1, [ ] ] ] ]) in [ 3, [ 2, [ 1, [ ] ] ] ] = index of value 3 in [ 3, [ 2, [ 1, [ ] ] ] ]
if the following are true:
- a = b
- b = c
- c = d
then a = d
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.