Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Continuing on from the previous question, write a function called my insertion sort (a list) which takes a list of numbers as a parameter. The
Continuing on from the previous question, write a function called my insertion sort (a list) which takes a list of numbers as a parameter. The function implements the Insertion Sort algorithm. Note: you can use the insertion_single_pass() function defined in the previous question, or you can simply use nested loops to solve this problem. Note: you must not use the sort() method or the sorted function in your solution. For example: Test Result numbers = [20, 27, 69, 10, 15, 41] [10, 15, 20, 27, 41, 69] my_insertion_sort(numbers) print(numbers) Answer: (penalty regime: 0, 0, 5, 10, 15, 20, 25. 30. 35, 40, 45.50%) Reset answer 1 def my_insertion_sort(a list): 2- for index in range(1, len(a list)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started