2 ms·
after thinking about it some more, i was skeptical that this really implements bubble sort, but after trying it, it does python version of the inner loop
by kragen 3y ago
after thinking about it some more, i was skeptical that this really implements bubble sort, but after trying it, it does
python version of the inner loop
max_ = arr[0]
for j in range(1, i):
y = arr[j]
arr[j - 1] = min(max_, y)
max_ = max(max_, y)
arr[i - 1] = max_