Allan Didier

Bubble Sort


Write a program to sort numbers using the Bubble Sort algorithm.


  • Bubble Sort

Program Details

Create a program that uses the Bubble Sort technique to sort an array of integers. The program should include the following.
See for a more detailed explanation of the Bubble Sort algorithm.

Main Program. Your program should:

    1. Create an array of 20 random integers from 1 to 100.
    2. Print the original, unordered array.
    3. Sorts the array of integers using the Bubble sort technique.
    4. Print the array during each major iteration of sorting to see how the sorting works. Print the array after each iteration of your main outer for loop (for i), not the inner loops (j and k).
    5. Print the final sorted array.