In shellSort, we make the array h-sorted for a large value of h. We keep reducing the value of h until it becomes 1. An array is said to be h-sorted if all sublists of every h’th element is sorted.
Array before sorting: 12 34 54 2 3 Array after sorting: 2 3 12 34 54
Please refer complete article on ShellSort for more details!
GeeksforGeeks has prepared a complete interview preparation course with premium videos, theory, practice problems, TA support and many more features. Please refer Placement 100 for details
- Java Program for ShellSort
- C++ Program for QuickSort
- C Program for ID3 Tagging
- Program for n-th even number
- Program to print the given Z Pattern
- Reasons for a C++ program crash
- C++ Program for Comb Sort
- C++ Program for Cycle Sort
- C++ Program for Pigeonhole Sort
- C++ Program for Cocktail Sort
- Program to print the given H Pattern
- C++ Program to find whether a no is power of two
- Wishing your Valentine with a Program!!
- C++ program for hashing with chaining
Improved By : ted1