This process is repeated until the end of the array. If there are 100 values to sort, each pass through the list will take 99 comparisons – and you might have to repeat it 99 times. After the first ...
Sorting algorithms are a common exercise for new programmers, and for good reason: they introduce many programming fundamentals at once, including loops and conditionals, arrays and lists, comparisons ...