Skip to content

Commit

Permalink
Update 2019-06-13-loop-invariant-proof.md
Browse files Browse the repository at this point in the history
  • Loading branch information
kounkou authored Sep 19, 2023
1 parent e1fdd4e commit 2efc2d7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion _posts/2019-06-13-loop-invariant-proof.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ To demonstrate that the buble sort produces the right result, let's describe the

- #### Maintenance
During the course of the execution, elements going from A[0] to A[i] will become the smallest elements and smaller than elements in the sub array going from A[i] to A[n]
We can notice that with the given code, an invariant is maintained on the left side of the element located at position i.
We can notice that with the given code, an invariant is maintained on the left side of the element located at position i

- #### Termination
The last step is a conclusion that is obvious here... indeed, at the end of the loops, i is equal to the size of the array - 1, len(A) - 1 being the last position.
Expand Down

0 comments on commit 2efc2d7

Please sign in to comment.