Project #5: Bubble
Write a program that performs a bubble sort
DESCRIPTION
Requirements
Write a program that performs a Bubble sort
The user should be able to input a list of integers separated by spaces Ex: 5 3 10 728 42
Your program should run on O(n^2) time with an early exit for sorted data
Your program must output each major step it takes in sorting the data
Clarification: Print once line for each execution of your outer loop
If you implement the challenges below, the program should use the original list each time
CHALLENGE (+10%)
Option #1 - Basic
Implement two extra O(n²) sorts
Examples: Selection Sort, Insertion Sort
Option #2 - Jokes
Implement two joke sorts
Examples: Bogo Sort, Stalin Sort
Option #3
Implement one O(n log n) sort
Examples: Merge Sort, Quick Sort
EXAMPLE: RUNNING PROGRAM
Enter Length of List to Sort
> 7
Enter List
> 5 3 2 1 9 82 7
Choose a Sort (0) Quit (1) Bubble
> 1
5 3 2 1 9 82 7
3 2 1 5 9 7 82
2 1 3 5 7 9 82
1 2 3 5 7 9 82
Choose a Sort (0) Quit (1) Bubble
> 0
Goodbye.