4 ms·
...Right.. unoptimized bubble sort.
by NotAnOtter 2y ago
...Right.. unoptimized bubble sort.
- ColinWright 2y agoOn any bubble sort, optimised or not, no swaps are made on an array that's already sorted. The routine in the article does. So no, it's not a bubble sort, unoptimised or otherwise. If you think it is a bubble sort then I'd be interested in seeing your implementation of a bubble sort, and an explanation as to why they are effectively the same.