diff --git a/Grade 10/Computer Science/ICS4U1/Sorting Methods/Shellsort List.md b/Grade 10/Computer Science/ICS4U1/Sorting Methods/Shellsort List.md index 2b10048..2c3f643 100644 --- a/Grade 10/Computer Science/ICS4U1/Sorting Methods/Shellsort List.md +++ b/Grade 10/Computer Science/ICS4U1/Sorting Methods/Shellsort List.md @@ -1,6 +1,7 @@ # Shell Sort Handout ## What is shell sort? +- "Diminishing Increment Sort", better known as comb sort - Combination of sorting by insertion (insertion sort) and sorting by exchange (bubble sort) - Starts off by comparing two elements that are far apart and gradually reduce the gap between them - It works better than regular insertion sort as it moves certain out of place elements into place faster @@ -44,4 +45,12 @@ public static void shellSort(int arr[]) // Method Header } } -``` \ No newline at end of file +``` + +## Enhanced Shell Sort +- A method to calculate the gap sequence and can decrease the number of comparisons by up to 60% +- Published by Basit Shahzad and Muhammad Tanvir Afzal from the World Academy of Science +- The gap sequence would be h1 and hn+1 = 3hn+1 +- For 100 elements, shell's original gap seuqence will make 170 comparisons but the Enhanced Shell Sort will make 85 comparisons + +