I have only need to do sorting of large datasets a few times in my career. Using a combination of sort techniques ended up being the fastest way. There's also some great info on the net about sorting. Interesting reading but rarely needed in real life....at least by me.
The part about bubble sort is incorrect Even if it's sorted it'll always take n2 time, and if you optimize by making the inner loop upper limit related to outer loop like ( j < len-1-i) then it'll still be (n(n-1))/2 which is still n2 If you talked about insertion sort what you said would've been correct as if you give it a sorted array it truly is 'n', and n2 if completely unsorted
I disagree with you. The way I write bubble sort uses a flag to see when we're done sorting. It would tell us we're done sorting after one round of swaps
@@GregHogg oh I see, in that case yes it is linear Most times when we see bubble sort programs we don't do the flag thing, without another variable telling us if we did swaps or not it is then n2 which is what I was going with My bad I didn't know that