Shell sort is one of the oldest sorting algorithm named after its inventor Donald L.Shell(1959).
It improves on the efficiences of insertion sort by quickly shifting values to their destination.
It is fast easy to understand and easy to implement.
Its complexity analysis is somewhat more sophisticated.
- This method makes repeated use of insertion sort.
- To sort n elements of an array by this method requires a number Si called increment or step should be chosen before every pass.
- Si should be less than n.
- For the last pass Si should be 1.
- Initial value of step or increments can be n/2 and in further passes Si should be previous pass i.e.
Sorting is a process of rearranging the data items in ascending or descending order.Here the data items are shifted from one location to the other.
Insertion sort is implemented by inserting a particular element(single element) at the appropriate position. In this method, the first iteration starts with comparison of 1’s element(second element) with the 0’s element(first element). In the second iteration 2nd element(third element) is compared with the 0’s and 1’s element.
Bubble sort is most popular sorting technique because it is very simple to understand and implement. The algorithm achieves its name from the fact that,with each iteration the largest value moves like a bubble to the top of the array. The bubble sort method is not efficient for large arrays.