Question:

Write a program to perform shell sort on [85,63,0,12,47,96,52]

Program:

Explanation:

Step 1 − Initialize the value of h

Step 2 − Divide the list into smaller sub-list of equal interval h

Step 3 − Sort these sub-lists using insertion sort

Step 4 − Repeat until complete list is sorted

Output:

 

Leave a Reply