Exercises for Chapter #6 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 Insertion 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 Insertion 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 Insertion Sort would take on the array.
- How many comparisons occurred?
- How many swaps occurred?

Describe in the following cases whether Bubble Sort is more efficient, or Insertion Sort is more efficient.

- The best-case scenario.
- An average-case scenario.
- The worst-case scenario.