Skip to content

Commit 20aa579

Browse files
committed
Fix README.md and added Contribution.md
1 parent 7043293 commit 20aa579

File tree

2 files changed

+5
-162
lines changed

2 files changed

+5
-162
lines changed

CONTRIBUTING.md

Whitespace-only changes.

README.md

Lines changed: 5 additions & 162 deletions
Original file line numberDiff line numberDiff line change
@@ -2,172 +2,15 @@
22

33
![golangci-lint](https://github.com/TheAlgorithms/Go/workflows/golangci-lint/badge.svg)
44
![Go](https://github.com/TheAlgorithms/Go/workflows/Go/badge.svg)
5+
![](https://img.shields.io/github/repo-size/TheAlgorithms/Go.svg?label=Repo%20size&style=flat-square) 
56
![update_directory_md](https://github.com/TheAlgorithms/Go/workflows/update_directory_md/badge.svg)
67

78
### Algorithms implemented in Go (for education)
89

9-
These algorithms are for demonstration purposes only. There are many sort implementations in the Go standard library that may have better performance.
10+
The repository is a collection of open-source implementation of a variety of algorithms implemented in Go and licensed under [MIT License](LICENSE).
1011

11-
For a full list of all algorithms, please see: [DIRECTORY.md](https://github.com/TheAlgorithms/Go/blob/master/DIRECTORY.md)
12+
Read our [Contribution Guidelines](CONTRIBUTING.md) before you contribute.
1213

13-
## Sort Algorithms
14+
## List of Algorithms
1415

15-
16-
### Bubble
17-
![alt text][bubble-image]
18-
19-
From [Wikipedia][bubble-wiki]: Bubble sort, sometimes referred to as sinking sort, is a simple sorting algorithm that repeatedly steps through the list to be sorted, compares each pair of adjacent items and swaps them if they are in the wrong order. The pass through the list is repeated until no swaps are needed, which indicates that the list is sorted.
20-
21-
__Properties__
22-
* Worst case performance O(n^2)
23-
* Best case performance O(n)
24-
* Average case performance O(n^2)
25-
26-
###### View the algorithm in [action][bubble-toptal]
27-
28-
29-
30-
### Insertion
31-
![alt text][insertion-image]
32-
33-
From [Wikipedia][insertion-wiki]: Insertion sort is a simple sorting algorithm that builds the final sorted array (or list) one item at a time. It is much less efficient on large lists than more advanced algorithms such as quicksort, heapsort, or merge sort.
34-
35-
__Properties__
36-
* Worst case performance O(n^2)
37-
* Best case performance O(n)
38-
* Average case performance O(n^2)
39-
40-
###### View the algorithm in [action][insertion-toptal]
41-
42-
43-
### Merge
44-
![alt text][merge-image]
45-
46-
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.
47-
48-
__Properties__
49-
* Worst case performance O(n log n)
50-
* Best case performance O(n)
51-
* Average case performance O(n)
52-
53-
54-
###### View the algorithm in [action][merge-toptal]
55-
56-
### Quick
57-
![alt text][quick-image]
58-
59-
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.
60-
61-
__Properties__
62-
* Worst case performance O(n^2)
63-
* Best case performance O(n log n) or O(n) with three-way partition
64-
* Average case performance O(n^2)
65-
66-
###### View the algorithm in [action][quick-toptal]
67-
68-
### Selection
69-
![alt text][selection-image]
70-
71-
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.
72-
73-
__Properties__
74-
* Worst case performance O(n^2)
75-
* Best case performance O(n^2)
76-
* Average case performance O(n^2)
77-
78-
###### View the algorithm in [action][selection-toptal]
79-
80-
### Shell
81-
![alt text][shell-image]
82-
83-
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 anywhere, considering every nth element gives a sorted list. Such a list is said to be h-sorted. Equivalently, it can be thought of as h interleaved lists, each individually sorted.
84-
85-
__Properties__
86-
* Worst case performance O(nlog2 2n)
87-
* Best case performance O(n log n)
88-
* Average case performance depends on gap sequence
89-
90-
###### View the algorithm in [action][shell-toptal]
91-
92-
### Time-Complexity Graphs
93-
94-
Comparing the complexity of sorting algorithms (Bubble Sort, Insertion Sort, Selection Sort)
95-
96-
[Complexity Graphs](https://github.com/prateekiiest/Python/blob/master/sorts/sortinggraphs.png)
97-
98-
----------------------------------------------------------------------------------
99-
100-
## Search Algorithms
101-
102-
### Linear
103-
![alt text][linear-image]
104-
105-
From [Wikipedia][linear-wiki]: linear search or sequential search is a method for finding a target value within a list. It sequentially checks each element of the list for the target value until a match is found or until all the elements have been searched.
106-
Linear search runs in at the worst linear time and makes at most n comparisons, where n is the length of the list.
107-
108-
__Properties__
109-
* Worst case performance O(n)
110-
* Best case performance O(1)
111-
* Average case performance O(n)
112-
* Worst case space complexity O(1) iterative
113-
114-
### Binary
115-
![alt text][binary-image]
116-
117-
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.
118-
119-
__Properties__
120-
* Worst case performance O(log n)
121-
* Best case performance O(1)
122-
* Average case performance O(log n)
123-
* Worst case space complexity O(1)
124-
125-
----------------------------------------------------------------------------------------------------------------------
126-
127-
## Ciphers
128-
129-
### Caesar
130-
![alt text][caesar]<br>
131-
In cryptography, a **Caesar cipher**, also known as Caesar's cipher, the shift cipher, Caesar's code or Caesar shift, is one of the simplest and most widely known encryption techniques.<br>
132-
It is **a type of substitution cipher** in which each letter in the plaintext is replaced by a letter some fixed number of positions down the alphabet. For example, with a left shift of 3, D would be replaced by A, E would become B, and so on. <br>
133-
The method is named after **Julius Caesar**, who used it in his private correspondence.<br>
134-
The encryption step performed by a Caesar cipher is often incorporated as part of more complex schemes, such as the Vigenère cipher, and still has modern applications in the ROT13 system. As with all single-alphabet substitution ciphers, the Caesar cipher is easily broken and in modern practice offers essentially no communication security.
135-
###### Source: [Wikipedia](https://en.wikipedia.org/wiki/Caesar_cipher)
136-
137-
### Transposition
138-
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>
139-
Mathematically a bijective function is used on the characters' positions to encrypt and an inverse function to decrypt.
140-
###### Source: [Wikipedia](https://en.wikipedia.org/wiki/Transposition_cipher)
141-
142-
[bubble-toptal]: https://www.toptal.com/developers/sorting-algorithms/bubble-sort
143-
[bubble-wiki]: https://en.wikipedia.org/wiki/Bubble_sort
144-
[bubble-image]: https://upload.wikimedia.org/wikipedia/commons/thumb/8/83/Bubblesort-edited-color.svg/220px-Bubblesort-edited-color.svg.png "Bubble Sort"
145-
146-
[insertion-toptal]: https://www.toptal.com/developers/sorting-algorithms/insertion-sort
147-
[insertion-wiki]: https://en.wikipedia.org/wiki/Insertion_sort
148-
[insertion-image]: https://upload.wikimedia.org/wikipedia/commons/7/7e/Insertionsort-edited.png "Insertion Sort"
149-
150-
[quick-toptal]: https://www.toptal.com/developers/sorting-algorithms/quick-sort
151-
[quick-wiki]: https://en.wikipedia.org/wiki/Quicksort
152-
[quick-image]: https://upload.wikimedia.org/wikipedia/commons/6/6a/Sorting_quicksort_anim.gif "Quick Sort"
153-
154-
[merge-toptal]: https://www.toptal.com/developers/sorting-algorithms/merge-sort
155-
[merge-wiki]: https://en.wikipedia.org/wiki/Merge_sort
156-
[merge-image]: https://upload.wikimedia.org/wikipedia/commons/c/cc/Merge-sort-example-300px.gif "Merge Sort"
157-
158-
[selection-toptal]: https://www.toptal.com/developers/sorting-algorithms/selection-sort
159-
[selection-wiki]: https://en.wikipedia.org/wiki/Selection_sort
160-
[selection-image]: https://upload.wikimedia.org/wikipedia/commons/thumb/b/b0/Selection_sort_animation.gif/250px-Selection_sort_animation.gif "Selection Sort Sort"
161-
162-
[shell-toptal]: https://www.toptal.com/developers/sorting-algorithms/shell-sort
163-
[shell-wiki]: https://en.wikipedia.org/wiki/Shellsort
164-
[shell-image]: https://upload.wikimedia.org/wikipedia/commons/d/d8/Sorting_shellsort_anim.gif "Shell Sort"
165-
166-
[linear-wiki]: https://en.wikipedia.org/wiki/Linear_search
167-
[linear-image]: http://www.tutorialspoint.com/data_structures_algorithms/images/linear_search.gif
168-
169-
[binary-wiki]: https://en.wikipedia.org/wiki/Binary_search_algorithm
170-
[binary-image]: https://upload.wikimedia.org/wikipedia/commons/f/f7/Binary_search_into_array.png
171-
172-
173-
[caesar]: https://upload.wikimedia.org/wikipedia/commons/4/4a/Caesar_cipher_left_shift_of_3.svg
16+
See our [directory](DIRECTORY.md).

0 commit comments

Comments
 (0)