This roughly doubles the speed of bubblesort() on random data: instead of bubbling along the entire list every outer-loop iteration, bubble one fewer element each iteration than the last time, since the maximal element will have already been moved to the end of the list.
This roughly doubles the speed of bubblesort() on random data: instead of bubbling along the entire list every outer-loop iteration, bubble one fewer element each iteration than the last time, since the maximal element will have already been moved to the end of the list.

RichardBarrell/snippets,RichardBarrell/snippets,RichardBarrell/snippets,RichardBarrell/snippets,RichardBarrell/snippets,RichardBarrell/snippets,RichardBarrell/snippets