I watched the Section video in week 3 which discussed Bubble sort. I also watched the lectures and the shorts on it. I understand how it works, except for one bit. I'm confused on the below image from the section (47.15 mins).
Specifically I am confused on two lines: 1) int swaps = 0. Why is this set to 0? Is that "true"? So does it mean that if the statement "there are no swaps" is true, then the program will run?
2) swaps++. So I guess here the swaps value is made into 1. And in the 2nd aray, it would become 2. What is the point of this?
Thank you.