How many slots?

Basic Sorting with BubbleSort

Putting lists (arrays) of elements into order is an important category of program. This program does this using a very inefficient sort called Bubble Sort.

We start with an array loaded with random integers between 0 and 1000. We repeatedly "bubble" the largest element up to the end of that array. After doing this "bubbling" over and over we eventually get the entire array into order.

Inputs

The user provides a single positive integer on the HTML page in a text box. This number tells how many random integers to generate into an array.

Outputs

The program prints the number of millisecods it takes to sort the array of random numbers.

Termination

The program ends on its own.