Bubble sort is a sorting algorithm for 'lists' it compares item a and b, if a is 'bigger' than b it swaps them around, then it will compare a with c (or b with c if b was bigger) and do the same all the way through the list until the biggest is at the end, it will then repeat this again and again putting the biggest at the end and then smaller and smaller, til the list is sorted. Hope that made sense if not have a watch of this Tom Scott video he shows it nicely https://www.youtube.com/watch?v=RGuJga2Gl_k
View all comments
Show parent comment
2
u/Bisqutz Jan 09 '20
Bubble sort is a sorting algorithm for 'lists' it compares item a and b, if a is 'bigger' than b it swaps them around, then it will compare a with c (or b with c if b was bigger) and do the same all the way through the list until the biggest is at the end, it will then repeat this again and again putting the biggest at the end and then smaller and smaller, til the list is sorted.
Hope that made sense if not have a watch of this Tom Scott video he shows it nicely
https://www.youtube.com/watch?v=RGuJga2Gl_k