What is bubble sorting? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

What is bubble sorting?

16th Sep 2016, 1:49 PM
Asif Ali
Asif Ali - avatar
1 Answer
+ 1
In a bubble sort, you browse all the array looking for the smallest element, then permute it with the first element, then browse all the array but the first element to look for the second smallest element, permute it with the second element, etc. In the end, your array is sorted. This sorting algorithm is pretty inefficient but simple, and a good subject of study to introduce more elaborated sorting algorithms.
16th Sep 2016, 2:09 PM
Zen
Zen - avatar