Question: Problem 1: Below is the Python Code for insertion sort: def insertion_sort(a): n = len(a) for i in range(1, n): j = i while (j
Problem 1:
Below is the Python Code for insertion sort:
def insertion_sort(a): n = len(a) for i in range(1, n): j = i while (j > 0) and (a[j]
It is being tested with the following Python list:
def main(): a = [5, 7, 12, 19, 21, 26,33,40,14,9,18,21,2] insertion_sort(a)
The Python list looks like the below when i=8 finishes execution and i turns to 9. ( See image below)

What does the list look like when i=9 finishes execution?
[]
What does the list look like when i=10 finishes execution?
[]
What does the list look like when i=11 finishes execution?
[]
def insertion_sort(a) a:
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
