Exercises for Chapter #4 of A Common-Sense Guide To Data Structures and Algorithms

Get The Book!Regarding the array [50, 60, 70, 20, 30, 10]:

- Describe the exact steps that Bubble Sort would take on the array.
- How many comparisons occurred?
- How many swaps occurred?

Regarding the array [10, 20, 30, 40, 50, 60]:

- Describe the exact steps that Bubble Sort would take on the array.
- How many comparisons occurred?
- How many swaps occurred?

Regarding the array [60, 50, 40, 30, 20, 10]:

- Describe the exact steps that Bubble Sort would take on the array.
- How many comparisons occurred?
- How many swaps occurred?

Describe the following code in terms of Big O Notation: