First Pass: Second Pass:
6 4 5 3 7 1 4 5 3 6 1 7
4 6 5 3 7 1 4 5 3 6 1 7
4 5 6 3 7 1 4 3 5 6 1 7
4 5 3 6 7 1 4 3 5 6 1 7
4 5 3 6 7 1 4 3 5 1 6 7
4 5 3 6 1 7 4 3 5 1 6 7
Third Pass:
4 3 5 1 6 7
3 4 5 1 6 7
3 4 5 1 6 7
3 4 1 5 6 7
3 4 1 5 6 7
3 4 1 5 6 7
so after 3 passes of Bubble Sort the final contents of the array is 3 4 1 5 6 7 .