@2bitchuck
It's called "bubble sort" because it's as if the lower values are floating to the top (or rather, left). The steps are as follows: 1. compare 3 and 10, 3 is less so no work. 2. compare 10 and 5, 5 is less so move it left until something lower (the 3). 3. compare 10 and 7, 7 is less so move it. 4. compare 10 and 2, 2 is less so move it (all the way over since it's lower than everything up to that point). 5. compare 10 and 13, 10 is less so no work to do. 6. compare 13 and 1, 1 is less so move it.
P#116231 2022-08-24 13:55
P#116232 2022-08-24 13:55 ( Edited 2022-08-24 14:01)
[Please log in to post a comment]