I’m not sure I understand… Everything works before the two first numbers?
No, everything after the two numbers. So if I have an array of [5, 7, 1, 3, 10, 6, 8, 0] then it’ll keep iterating, just not moving the 5 becuase it’s less than 7. Then, after the first few iterations, it looks more like [5, 0, 1, 3, 6, 7, 8, 10] But it never moves the 5. It just repeats that. I don’t know why or what makes it have a fit at the last iteration.
Hmm, that looks like an infinite loop. Is the first element of array even ever compared during the sorting pass?
It should. It takes the the ‘i’ element of the array into consideration. “i” starts at 0, so it should, in theory, sort the first element.
It should, but does it?