Question: 2. If all n elements in the input array are the same, what is the big O notation of Insertion Sort? Why? (20 points)
2. If all n elements in the input array are the same, what is the big O notation of Insertion Sort? Why? (20 points) INSERTION-SORT(A) 1 for 2 to A.length key=A[j] //Insert A[] into the sorted 2 3 sequence A[1..-1]. 4 5 while i 0 and A[i]> key 6 Alt+1] 7-1-1 A[] 8 A[+]=key 13
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
