3 ms·
Hmm, I was taught this is the “lazy” variation of bubble sort with a lot of unnecessary comparisons.
by trungdq88 5y ago
Hmm, I was taught this is the “lazy” variation of bubble sort with a lot of unnecessary comparisons.
- Dylan16807 5y agoAre you sure? With two separately incrementing indexes? Lazy bubble sort would still have a double loop counting to n, but it should be comparing A[j] and A[j+1]. 'i' would not be used inside the loop.