Bubble sort was not what I thought it was.
Algorithms
3
Posts
3
Posters
79
Views
-
I used to think bubble sort like this:
i=0 to array.length j=i+1 to array.length if(array[i]>arr[j] swap them
I have been thinking like that for a long amount of time. Where did I go wrong? Which type of sorting algorithm am I talking about?
-
It is "exchange sort" https://en.wikipedia.org/wiki/Sorting_algorithm#Exchange_sort