0
Bubble sort...or is it?
I made two sort algos, one (the first one) definitely is a bubble sort as it compares two adjacent elements with reduced range as it goes along...but the second one uses the outer loops range variable in the compare and swap routine. Both do the job, the second one is faster...but what type of sort is it (the second one)? https://code.sololearn.com/ceJ7trrQ9tnV/#py
2 Réponses
+ 3
It is Selection Sort.
https://www.sololearn.com/learn/703/
The difference is that your algorithm takes the maximum element during each iteration.
+ 1
Thank you for your reply.