Proof: Pop Index Example 2
Let's prove the following theorem:
remaining elements after [ 3, [ 2, [ 1, [ ] ] ] ] is popped at index 0 = [ 2, [ 1, [ ] ] ]
Proof:
# | Claim | Reason |
---|---|---|
1 | remaining elements after [ 3, [ 2, [ 1, [ ] ] ] ] is popped at index 0 = remaining elements after [ 3, [ 2, [ 1, [ ] ] ] ] is popped at index 0 and visited stack is [ ] | remaining elements after [ 3, [ 2, [ 1, [ ] ] ] ] is popped at index 0 = remaining elements after [ 3, [ 2, [ 1, [ ] ] ] ] is popped at index 0 and visited stack is [ ] |
2 | remaining elements after [ 3, [ 2, [ 1, [ ] ] ] ] is popped at index 0 and visited stack is [ ] = [ 2, [ 1, [ ] ] ] | remaining elements after [ 3, [ 2, [ 1, [ ] ] ] ] is popped at index 0 and visited stack is [ ] = [ 2, [ 1, [ ] ] ] |
3 | remaining elements after [ 3, [ 2, [ 1, [ ] ] ] ] is popped at index 0 = [ 2, [ 1, [ ] ] ] | if remaining elements after [ 3, [ 2, [ 1, [ ] ] ] ] is popped at index 0 = remaining elements after [ 3, [ 2, [ 1, [ ] ] ] ] is popped at index 0 and visited stack is [ ] and remaining elements after [ 3, [ 2, [ 1, [ ] ] ] ] is popped at index 0 and visited stack is [ ] = [ 2, [ 1, [ ] ] ], then remaining elements after [ 3, [ 2, [ 1, [ ] ] ] ] is popped at index 0 = [ 2, [ 1, [ ] ] ] |
Comments
Please log in to add comments