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
These are for demonstration purposes only. There are many implementations of sorts in the Python standard library that are much better for performance reasons.
6
6
7
-
## Sorting
8
-
7
+
## Sorting Algorithms
9
8
10
9
### Binary
11
-
10
+
Add comments here
12
11
13
12
### Bubble
14
13
![alt text][bubble-image]
15
14
16
15
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
16
18
17
__Properties__
19
-
* Stable
20
18
* Worst case performance O(n^2)
21
19
* Best case performance O(n)
22
20
* Average case performance O(n^2)
@@ -26,15 +24,14 @@ __Properties__
26
24
27
25
28
26
### Caesar
29
-
27
+
Add comments here
30
28
31
29
### Insertion
32
30
![alt text][insertion-image]
33
31
34
32
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.
35
33
36
34
__Properties__
37
-
* Stable
38
35
* Worst case performance O(n^2)
39
36
* Best case performance O(n)
40
37
* Average case performance O(n^2)
@@ -43,6 +40,18 @@ __Properties__
43
40
###### View the algorithm in [action][insertion-toptal]
44
41
45
42
43
+
## Quick
44
+
![alt text][quick-image]
45
+
46
+
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.
47
+
48
+
__Properties__
49
+
* Worst case performance O(n^2)
50
+
* Best case performance O(n log n) or O(n) with three-way partition
51
+
* Average case performance O(n^2)
52
+
53
+
54
+
###### View the algorithm in [action][quick-toptal]
0 commit comments