Question: Apply insertion sort to sort the list 4, 15, 36, 30, 3, 9. (a) How does the algorithm know when the list is sorted? (b)

Apply insertion sort to sort the list 4, 15, 36, 30, 3, 9. (a) How does the algorithm know when the list is sorted?

(b) What is the maximum number of comparisons required for a list of six numbers?

(c) How many comparisons did you actually require for the given list?

Please explain your working. I do not want a rushed answer. thanks

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!