@TheFerruccio - No. It sweeps through progressively 1 fewer entry each time. Cause the algorithm bubbles up the largest number to the final position, so we already know that final position is the largest, no need to check it again. On the next sweep, we can just ignore it. You can model it recursively.
jo tyż nie wia
bonon15 3 months ago
co ja pacze
ocznik 3 months ago
I thought bubble sort swept through the whole list each time...
TheFerruccio 1 year ago
@TheFerruccio - No. It sweeps through progressively 1 fewer entry each time. Cause the algorithm bubbles up the largest number to the final position, so we already know that final position is the largest, no need to check it again. On the next sweep, we can just ignore it. You can model it recursively.
Theowne 1 year ago
@Theowne so v=t8g-iYGHpEA is incorrect?
TheFerruccio 1 year ago
Almost, but no. Your are checking one too much each iteration
ostmackan2 1 year ago
You should have done a mini-freeze each time the moving part of the array changes
TeTRoSeX 1 year ago
not very good....but thankssss:)
sisse54 2 years ago