You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+26-26Lines changed: 26 additions & 26 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,9 +16,9 @@ Also see: https://algorithmswithgo.com
16
16
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.
17
17
18
18
__Properties__
19
-
* Worst case performanceO(n^2)
20
-
* Best case performanceO(n)
21
-
* Average case performanceO(n^2)
19
+
* Worst case performanceO(n^2)
20
+
* Best case performanceO(n)
21
+
* Average case performanceO(n^2)
22
22
23
23
###### View the algorithm in [action][bubble-toptal]
24
24
@@ -30,9 +30,9 @@ __Properties__
30
30
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.
31
31
32
32
__Properties__
33
-
* Worst case performanceO(n^2)
34
-
* Best case performanceO(n)
35
-
* Average case performanceO(n^2)
33
+
* Worst case performanceO(n^2)
34
+
* Best case performanceO(n)
35
+
* Average case performanceO(n^2)
36
36
37
37
###### View the algorithm in [action][insertion-toptal]
38
38
@@ -43,9 +43,9 @@ __Properties__
43
43
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.
44
44
45
45
__Properties__
46
-
* Worst case performanceO(n log n)
47
-
* Best case performanceO(n)
48
-
* Average case performanceO(n)
46
+
* Worst case performanceO(n log n)
47
+
* Best case performanceO(n)
48
+
* Average case performanceO(n)
49
49
50
50
51
51
###### View the algorithm in [action][merge-toptal]
@@ -56,9 +56,9 @@ __Properties__
56
56
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.
57
57
58
58
__Properties__
59
-
* Worst case performanceO(n^2)
60
-
* Best case performanceO(n log n) or O(n) with three-way partition
61
-
* Average case performanceO(n^2)
59
+
* Worst case performanceO(n^2)
60
+
* Best case performanceO(n log n) or O(n) with three-way partition
61
+
* Average case performanceO(n^2)
62
62
63
63
###### View the algorithm in [action][quick-toptal]
64
64
@@ -68,9 +68,9 @@ __Properties__
68
68
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.
69
69
70
70
__Properties__
71
-
* Worst case performanceO(n^2)
72
-
* Best case performanceO(n^2)
73
-
* Average case performanceO(n^2)
71
+
* Worst case performanceO(n^2)
72
+
* Best case performanceO(n^2)
73
+
* Average case performanceO(n^2)
74
74
75
75
###### View the algorithm in [action][selection-toptal]
76
76
@@ -86,7 +86,7 @@ __Properties__
86
86
87
87
###### View the algorithm in [action][shell-toptal]
88
88
89
-
### Time-Compexity Graphs
89
+
### Time-Complexity Graphs
90
90
91
91
Comparing the complexity of sorting algorithms (Bubble Sort, Insertion Sort, Selection Sort)
92
92
@@ -100,24 +100,24 @@ Comparing the complexity of sorting algorithms (Bubble Sort, Insertion Sort, Sel
100
100
![alt text][linear-image]
101
101
102
102
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.
103
-
Linear search runs in at worst linear time and makes at most n comparisons, where n is the length of the list.
103
+
Linear search runs in at the worst linear time and makes at most n comparisons, where n is the length of the list.
104
104
105
105
__Properties__
106
-
* Worst case performanceO(n)
107
-
* Best case performanceO(1)
108
-
* Average case performanceO(n)
109
-
* Worst case space complexityO(1) iterative
106
+
* Worst case performanceO(n)
107
+
* Best case performanceO(1)
108
+
* Average case performanceO(n)
109
+
* Worst case space complexityO(1) iterative
110
110
111
111
### Binary
112
112
![alt text][binary-image]
113
113
114
114
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.
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>
129
129
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>
130
130
The method is named after **Julius Caesar**, who used it in his private correspondence.<br>
131
-
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 application 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.
131
+
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.
0 commit comments