Skip to content

Commit de17460

Browse files
Merge pull request TheAlgorithms#20 from Knhash/patch-1
Update README.md
2 parents 22a4f26 + 2b34ad5 commit de17460

File tree

1 file changed

+21
-8
lines changed

1 file changed

+21
-8
lines changed

README.md

+21-8
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,8 @@
44

55
These are for demonstration purposes only. There are many implementations of sorts in the Python standard library that are much better for performance reasons.
66

7-
## Sorting Algorithms
7+
## Sort Algorithms
88

9-
### Binary
10-
Add comments here
119

1210
### Bubble
1311
![alt text][bubble-image]
@@ -36,7 +34,7 @@ __Properties__
3634
###### View the algorithm in [action][insertion-toptal]
3735

3836

39-
## Merge
37+
### Merge
4038
![alt text][merge-image]
4139

4240
From [Wikipedia][merge-wiki]: In computer science, merge sort (also commonly spelled mergesort) is an efficient, general-purpose, comparison-based sorting algorithm. Most implementations produce a stable sort, which means that the implementation preserves the input order of equal elements in the sorted output. Mergesort is a divide and conquer algorithm that was invented by John von Neumann in 1945.
@@ -49,7 +47,7 @@ __Properties__
4947

5048
###### View the algorithm in [action][merge-toptal]
5149

52-
## Quick
50+
### Quick
5351
![alt text][quick-image]
5452

5553
From [Wikipedia][quick-wiki]: Quicksort (sometimes called partition-exchange sort) is an efficient sorting algorithm, serving as a systematic method for placing the elements of an array in order.
@@ -61,7 +59,7 @@ __Properties__
6159

6260
###### View the algorithm in [action][quick-toptal]
6361

64-
## Selection
62+
### Selection
6563
![alt text][selection-image]
6664

6765
From [Wikipedia][selection-wiki]: The algorithm divides the input list into two parts: the sublist of items already sorted, which is built up from left to right at the front (left) of the list, and the sublist of items remaining to be sorted that occupy the rest of the list. Initially, the sorted sublist is empty and the unsorted sublist is the entire input list. The algorithm proceeds by finding the smallest (or largest, depending on sorting order) element in the unsorted sublist, exchanging (swapping) it with the leftmost unsorted element (putting it in sorted order), and moving the sublist boundaries one element to the right.
@@ -73,7 +71,7 @@ __Properties__
7371

7472
###### View the algorithm in [action][selection-toptal]
7573

76-
## Shell sort
74+
### Shell
7775
![alt text][shell-image]
7876

7977
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.
@@ -99,7 +97,16 @@ __Properties__
9997
* Average case performance O(n)
10098
* Worst case space complexity O(1) iterative
10199

100+
### Binary
101+
![alt text][binary-image]
102+
103+
From [Wikipedia][binary-wiki]: Binary search, also known as half-interval search or logarithmic search, is a search algorithm that finds the position of a target value within a sorted array. It compares the target value to the middle element of the array; if they are unequal, the half in which the target cannot lie is eliminated and the search continues on the remaining half until it is successful.
102104

105+
__Properties__
106+
* Worst case performance O(log n)
107+
* Best case performance O(1)
108+
* Average case performance O(log n)
109+
* Worst case space complexity O(1)
103110

104111
## Ciphers
105112

@@ -115,6 +122,7 @@ The encryption step performed by a Caesar cipher is often incorporated as part o
115122
In cryptography, a **transposition cipher** is a method of encryption by which the positions held by units of plaintext (which are commonly characters or groups of characters) are shifted according to a regular system, so that the ciphertext constitutes a permutation of the plaintext. That is, the order of the units is changed (the plaintext is reordered).<br>
116123
Mathematically a bijective function is used on the characters' positions to encrypt and an inverse function to decrypt.
117124
###### Source: [Wikipedia](https://en.wikipedia.org/wiki/Transposition_cipher)
125+
118126
[bubble-toptal]: https://www.toptal.com/developers/sorting-algorithms/bubble-sort
119127
[bubble-wiki]: https://en.wikipedia.org/wiki/Bubble_sort
120128
[bubble-image]: https://upload.wikimedia.org/wikipedia/commons/thumb/8/83/Bubblesort-edited-color.svg/220px-Bubblesort-edited-color.svg.png "Bubble Sort"
@@ -139,6 +147,11 @@ Mathematically a bijective function is used on the characters' positions to encr
139147
[shell-wiki]: https://en.wikipedia.org/wiki/Shellsort
140148
[shell-image]: https://upload.wikimedia.org/wikipedia/commons/d/d8/Sorting_shellsort_anim.gif "Shell Sort"
141149

142-
[caesar]: https://upload.wikimedia.org/wikipedia/commons/4/4a/Caesar_cipher_left_shift_of_3.svg
143150
[linear-wiki]: https://en.wikipedia.org/wiki/Linear_search
144151
[linear-image]: http://www.tutorialspoint.com/data_structures_algorithms/images/linear_search.gif
152+
153+
[binary-wiki]: https://en.wikipedia.org/wiki/Binary_search_algorithm
154+
[binary-image]: https://upload.wikimedia.org/wikipedia/commons/f/f7/Binary_search_into_array.png
155+
156+
157+
[caesar]: https://upload.wikimedia.org/wikipedia/commons/4/4a/Caesar_cipher_left_shift_of_3.svg

0 commit comments

Comments
 (0)