Shell Sort is a sorting algorithm which works in sub quadratic time. Shell Sort works by comparing elements that are distant rather than adjacent elements in an array or list. Shell Sort makes multiple passes through a list and sorts the lists using insertion sort. Shell Sort improves the insertion sort by quickly shifting values to their destinations. Shell Sort is also called diminishing increment sort because the distance between comparisons decreases as the algorithm proceeds. In the final phase adjacent elements are compared. The efficiency of Shell Sort largely depends on the increment sequence. It is faster than bubble sort, insertion sort and selection sort. But Shell Sort is slower than heap sort, merge sort and quick sort.
No comments:
Post a Comment