Question: Consider k = 3 and k = 2 . Shell sort will sort the array by first applying insertion sort to k = 3 subarrays,
Consider k and k Shell sort will sort the array by first applying insertion sort to k
subarrays, followed by applying insertion sort to k subarrays. It turns out that the resulted
sorted array is still sorted. In other words, if we subdivide the sorted array into k subarrays
according to the definition of subarrays in the context of Shell sort each of the k subarrays
is still sorted.
Justify that now, each element in the array is at most one position off its correct position.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
