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