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