# Shell Sort

# **SHELL SORT**

**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.

**METHOD......**

- This method makes repeated use of insertion sort.
- To sort n elements of an array by this method requires a number S
_{i}called increment or step should be chosen before every pass. - S
_{i}should be less than n. - For the last pass S
_{i}should be 1. - Initial value of step or increments can be n/2 and in further passes S
_{i}should be previous pass i.e.

# Insertion sort

**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 2^{nd} element(third element) is compared with the 0’s and 1’s element.

# Bubble Sort Program

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.