Skip to content

Commit 8a4b335

Browse files
authored
Added Shell sort to readme
1 parent 95ff389 commit 8a4b335

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

README.md

+16
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,17 @@ __Properties__
7373

7474
###### View the algorithm in [action][selection-toptal]
7575

76+
## Shell sort
77+
![alt text][shell-image]
78+
79+
From [Wikipedia][shell-wiki]: Shellsort is a generalization of insertion sort that allows the exchange of items that are far apart. The idea is to arrange the list of elements so that, starting anywherem considereing every nth element gives a sorted list. Such a list is said to be h-sorted. Equivanelty, it can be thought of as h intterleaved lists, each individually sorted.
80+
81+
__Properties__
82+
* Worst case performance O(nlog2 2n)
83+
* Best case performance O(n log n)
84+
* Average case performance depends on gap sequence
85+
86+
###### View the algorithm in [action][shell-toptal]
7687

7788
## Search Algorithms
7889

@@ -123,6 +134,11 @@ Mathematically a bijective function is used on the characters' positions to encr
123134
[selection-toptal]: https://www.toptal.com/developers/sorting-algorithms/selection-sort
124135
[selection-wiki]: https://en.wikipedia.org/wiki/Selection_sort
125136
[selection-image]: https://upload.wikimedia.org/wikipedia/commons/thumb/b/b0/Selection_sort_animation.gif/250px-Selection_sort_animation.gif "Selection Sort Sort"
137+
138+
[shell-toptal]: https://www.toptal.com/developers/sorting-algorithms/shell-sort
139+
[shell-wiki]: https://en.wikipedia.org/wiki/Shellsort
140+
[shell-image]: https://upload.wikimedia.org/wikipedia/commons/d/d8/Sorting_shellsort_anim.gif "Shell Sort"
141+
126142
[caesar]: https://upload.wikimedia.org/wikipedia/commons/4/4a/Caesar_cipher_left_shift_of_3.svg
127143
[linear-wiki]: https://en.wikipedia.org/wiki/Linear_search
128144
[linear-image]: http://www.tutorialspoint.com/data_structures_algorithms/images/linear_search.gif

0 commit comments

Comments
 (0)