Shell_Sort
Shell_Sort
Shell Sort
Algorithm Overview and Applications
Time Complexity
• Worst Case: O(n²)
• Best Case: O(n log² n)
• Average Case: Depends on gap sequence, typically better than O(n²)
Space Complexity
• In-Place Sorting: O(1) auxiliary space
• No additional memory required.
Advantages & Disadvantages
Advantages:
• - Faster than Insertion Sort for larger arrays
• - Easy to implement
Disadvantages:
• - Not stable
• - Performance depends
on gap sequence
Use Cases
Summary:
• Shell Sort is an optimized version of insertion sort.
• Efficient for medium-sized arrays when an
appropriate gap sequence is used.
• It sort the array based on the Gap