+ 4
To be honest, I really deem lines 3 and 4 as redundant here - they do nothing. Other than that - the algorithm checks for whether the particular list element is greater than the next item on the right and if so, swaps them and moves forward to the next item, does the same thing and so on, until all items are sorted in the ascending order. I made a similar code with explanations: https://code.sololearn.com/cgICdtdr5osG/?ref=app
24th Apr 2018, 8:59 PM
Kuba SiekierzyƄski
Kuba SiekierzyƄski - avatar