Download - 01 - 01 January - Sorting
![Page 1: 01 - 01 January - Sorting](https://reader033.vdocuments.site/reader033/viewer/2022042722/58a50ebb1a28ab8e1c8b56f9/html5/thumbnails/1.jpg)
CS 321. Algorithm Analysis & Design Lecture 1
Sorting
![Page 2: 01 - 01 January - Sorting](https://reader033.vdocuments.site/reader033/viewer/2022042722/58a50ebb1a28ab8e1c8b56f9/html5/thumbnails/2.jpg)
Announcements
![Page 4: 01 - 01 January - Sorting](https://reader033.vdocuments.site/reader033/viewer/2022042722/58a50ebb1a28ab8e1c8b56f9/html5/thumbnails/4.jpg)
Announcements
The course website is at http://cs321.xyz
Please take the informal survey on the website, or send me an email with the subject [CS321].
![Page 5: 01 - 01 January - Sorting](https://reader033.vdocuments.site/reader033/viewer/2022042722/58a50ebb1a28ab8e1c8b56f9/html5/thumbnails/5.jpg)
Agenda
![Page 6: 01 - 01 January - Sorting](https://reader033.vdocuments.site/reader033/viewer/2022042722/58a50ebb1a28ab8e1c8b56f9/html5/thumbnails/6.jpg)
Agenda
Sorting Algorithms
![Page 7: 01 - 01 January - Sorting](https://reader033.vdocuments.site/reader033/viewer/2022042722/58a50ebb1a28ab8e1c8b56f9/html5/thumbnails/7.jpg)
Agenda
Sorting Algorithms
Lower Bounds
![Page 8: 01 - 01 January - Sorting](https://reader033.vdocuments.site/reader033/viewer/2022042722/58a50ebb1a28ab8e1c8b56f9/html5/thumbnails/8.jpg)
Agenda
Sorting Algorithms
Lower Bounds
Preference Aggregation
![Page 9: 01 - 01 January - Sorting](https://reader033.vdocuments.site/reader033/viewer/2022042722/58a50ebb1a28ab8e1c8b56f9/html5/thumbnails/9.jpg)
Sorting
![Page 10: 01 - 01 January - Sorting](https://reader033.vdocuments.site/reader033/viewer/2022042722/58a50ebb1a28ab8e1c8b56f9/html5/thumbnails/10.jpg)
4 4 2 1 2 5 6
1 2 2 4 7 9 7
6 4 5 5 9 4 3
7 4 5 9 7 3 8
![Page 11: 01 - 01 January - Sorting](https://reader033.vdocuments.site/reader033/viewer/2022042722/58a50ebb1a28ab8e1c8b56f9/html5/thumbnails/11.jpg)
4 4
21 2
5 6
1 2 2
4
7 97
6
4
5 5
9
43
7
4
5
97
3
8
![Page 12: 01 - 01 January - Sorting](https://reader033.vdocuments.site/reader033/viewer/2022042722/58a50ebb1a28ab8e1c8b56f9/html5/thumbnails/12.jpg)
Counting Sort
![Page 13: 01 - 01 January - Sorting](https://reader033.vdocuments.site/reader033/viewer/2022042722/58a50ebb1a28ab8e1c8b56f9/html5/thumbnails/13.jpg)
45986 45382 39590 99921
75987 55321 78324 52011
12001 99215 54213
32007 14261 12345 77666
11100
![Page 14: 01 - 01 January - Sorting](https://reader033.vdocuments.site/reader033/viewer/2022042722/58a50ebb1a28ab8e1c8b56f9/html5/thumbnails/14.jpg)
45986 45382 39590 99921
75987 55321 78324 52011
12001 99215 54213
32007 14261 12345 77666
11100
![Page 15: 01 - 01 January - Sorting](https://reader033.vdocuments.site/reader033/viewer/2022042722/58a50ebb1a28ab8e1c8b56f9/html5/thumbnails/15.jpg)
45986 4538239590
9992175987
55321
78324
52011
12001
99215
54213
32007
14261 12345
77666
11100
![Page 16: 01 - 01 January - Sorting](https://reader033.vdocuments.site/reader033/viewer/2022042722/58a50ebb1a28ab8e1c8b56f9/html5/thumbnails/16.jpg)
459864538239590
99921
7598755321
78324
52011
12001
99215
54213
32007
1426112345
77666
11100
![Page 17: 01 - 01 January - Sorting](https://reader033.vdocuments.site/reader033/viewer/2022042722/58a50ebb1a28ab8e1c8b56f9/html5/thumbnails/17.jpg)
Bucket Sort
![Page 18: 01 - 01 January - Sorting](https://reader033.vdocuments.site/reader033/viewer/2022042722/58a50ebb1a28ab8e1c8b56f9/html5/thumbnails/18.jpg)
21 25 32 45 90 63 72
![Page 19: 01 - 01 January - Sorting](https://reader033.vdocuments.site/reader033/viewer/2022042722/58a50ebb1a28ab8e1c8b56f9/html5/thumbnails/19.jpg)
21 25 32 45 90 63 72
![Page 20: 01 - 01 January - Sorting](https://reader033.vdocuments.site/reader033/viewer/2022042722/58a50ebb1a28ab8e1c8b56f9/html5/thumbnails/20.jpg)
21 25 32 45 90 63 72
![Page 21: 01 - 01 January - Sorting](https://reader033.vdocuments.site/reader033/viewer/2022042722/58a50ebb1a28ab8e1c8b56f9/html5/thumbnails/21.jpg)
21 25 32 45 90 63 72
![Page 22: 01 - 01 January - Sorting](https://reader033.vdocuments.site/reader033/viewer/2022042722/58a50ebb1a28ab8e1c8b56f9/html5/thumbnails/22.jpg)
21 25 32 45 90 63 72
![Page 23: 01 - 01 January - Sorting](https://reader033.vdocuments.site/reader033/viewer/2022042722/58a50ebb1a28ab8e1c8b56f9/html5/thumbnails/23.jpg)
21 25 32 45 90 63 72
![Page 24: 01 - 01 January - Sorting](https://reader033.vdocuments.site/reader033/viewer/2022042722/58a50ebb1a28ab8e1c8b56f9/html5/thumbnails/24.jpg)
21 25 32 45 9063 72
![Page 25: 01 - 01 January - Sorting](https://reader033.vdocuments.site/reader033/viewer/2022042722/58a50ebb1a28ab8e1c8b56f9/html5/thumbnails/25.jpg)
21 25 32 45 9063 72
![Page 26: 01 - 01 January - Sorting](https://reader033.vdocuments.site/reader033/viewer/2022042722/58a50ebb1a28ab8e1c8b56f9/html5/thumbnails/26.jpg)
21 25 32 45 9063 72
![Page 27: 01 - 01 January - Sorting](https://reader033.vdocuments.site/reader033/viewer/2022042722/58a50ebb1a28ab8e1c8b56f9/html5/thumbnails/27.jpg)
21 25 32 45 9063 72
![Page 28: 01 - 01 January - Sorting](https://reader033.vdocuments.site/reader033/viewer/2022042722/58a50ebb1a28ab8e1c8b56f9/html5/thumbnails/28.jpg)
21 25 32 45 9063 72
21 25 32 45 9063 72
![Page 29: 01 - 01 January - Sorting](https://reader033.vdocuments.site/reader033/viewer/2022042722/58a50ebb1a28ab8e1c8b56f9/html5/thumbnails/29.jpg)
21 25 32 45 9063 72
21 25 32 45 9063 72
![Page 30: 01 - 01 January - Sorting](https://reader033.vdocuments.site/reader033/viewer/2022042722/58a50ebb1a28ab8e1c8b56f9/html5/thumbnails/30.jpg)
21 25 32 45 9063 72
21 25 32 45 9063 72
![Page 31: 01 - 01 January - Sorting](https://reader033.vdocuments.site/reader033/viewer/2022042722/58a50ebb1a28ab8e1c8b56f9/html5/thumbnails/31.jpg)
Bubble Sort
![Page 32: 01 - 01 January - Sorting](https://reader033.vdocuments.site/reader033/viewer/2022042722/58a50ebb1a28ab8e1c8b56f9/html5/thumbnails/32.jpg)
21 25 32 45 63 72
35
![Page 33: 01 - 01 January - Sorting](https://reader033.vdocuments.site/reader033/viewer/2022042722/58a50ebb1a28ab8e1c8b56f9/html5/thumbnails/33.jpg)
21 25 32 45 63 72
35
![Page 34: 01 - 01 January - Sorting](https://reader033.vdocuments.site/reader033/viewer/2022042722/58a50ebb1a28ab8e1c8b56f9/html5/thumbnails/34.jpg)
21 25 32 45 63 72
35
![Page 35: 01 - 01 January - Sorting](https://reader033.vdocuments.site/reader033/viewer/2022042722/58a50ebb1a28ab8e1c8b56f9/html5/thumbnails/35.jpg)
21 25 32 45 63 72
35
![Page 36: 01 - 01 January - Sorting](https://reader033.vdocuments.site/reader033/viewer/2022042722/58a50ebb1a28ab8e1c8b56f9/html5/thumbnails/36.jpg)
21 25 32 45 63 72
35
![Page 37: 01 - 01 January - Sorting](https://reader033.vdocuments.site/reader033/viewer/2022042722/58a50ebb1a28ab8e1c8b56f9/html5/thumbnails/37.jpg)
21 25 32 45 63 7235
![Page 38: 01 - 01 January - Sorting](https://reader033.vdocuments.site/reader033/viewer/2022042722/58a50ebb1a28ab8e1c8b56f9/html5/thumbnails/38.jpg)
24 31 23 14 56 62 11
10 32 21 89 22 54 12
42 19 51 78 9 14 3
99 27 50 88 63 70 81
![Page 39: 01 - 01 January - Sorting](https://reader033.vdocuments.site/reader033/viewer/2022042722/58a50ebb1a28ab8e1c8b56f9/html5/thumbnails/39.jpg)
24 31 23 14 56 62 11
10 32 21 89 22 54 12
42 19 51 78 9 14 3
99 27 50 88 63 70 81
![Page 40: 01 - 01 January - Sorting](https://reader033.vdocuments.site/reader033/viewer/2022042722/58a50ebb1a28ab8e1c8b56f9/html5/thumbnails/40.jpg)
24 31 23 14 56 62 11
10 32 21 89 22 54 12
42 19 51 78 9 14 3
99 27 50 88 63 70 81
![Page 41: 01 - 01 January - Sorting](https://reader033.vdocuments.site/reader033/viewer/2022042722/58a50ebb1a28ab8e1c8b56f9/html5/thumbnails/41.jpg)
24 3123 14 56 62 11
10 32 21 89 22 54 12
42 19 51 78 9 14 3
99 27 50 88 63 70 81
![Page 42: 01 - 01 January - Sorting](https://reader033.vdocuments.site/reader033/viewer/2022042722/58a50ebb1a28ab8e1c8b56f9/html5/thumbnails/42.jpg)
24 3123 14 56 62 11
10 32 21 89 22 54 12
42 19 51 78 9 14 3
99 27 50 88 63 70 81
![Page 43: 01 - 01 January - Sorting](https://reader033.vdocuments.site/reader033/viewer/2022042722/58a50ebb1a28ab8e1c8b56f9/html5/thumbnails/43.jpg)
24 312314 56 62 11
10 32 21 89 22 54 12
42 19 51 78 9 14 3
99 27 50 88 63 70 81
![Page 44: 01 - 01 January - Sorting](https://reader033.vdocuments.site/reader033/viewer/2022042722/58a50ebb1a28ab8e1c8b56f9/html5/thumbnails/44.jpg)
21 25 32 45 63 72
35
![Page 45: 01 - 01 January - Sorting](https://reader033.vdocuments.site/reader033/viewer/2022042722/58a50ebb1a28ab8e1c8b56f9/html5/thumbnails/45.jpg)
21 25 32 45 63 72
35
Use binary search to reduce the number of comparisons.
![Page 46: 01 - 01 January - Sorting](https://reader033.vdocuments.site/reader033/viewer/2022042722/58a50ebb1a28ab8e1c8b56f9/html5/thumbnails/46.jpg)
Insertion Sort
![Page 47: 01 - 01 January - Sorting](https://reader033.vdocuments.site/reader033/viewer/2022042722/58a50ebb1a28ab8e1c8b56f9/html5/thumbnails/47.jpg)
21 25 32 41 55 63 72
10 22 45 53 62 64 90
![Page 48: 01 - 01 January - Sorting](https://reader033.vdocuments.site/reader033/viewer/2022042722/58a50ebb1a28ab8e1c8b56f9/html5/thumbnails/48.jpg)
21 25 32 41 55 63 72
10 22 45 53 62 64 90
![Page 49: 01 - 01 January - Sorting](https://reader033.vdocuments.site/reader033/viewer/2022042722/58a50ebb1a28ab8e1c8b56f9/html5/thumbnails/49.jpg)
21 25 32 41 55 63 72
10
22 45 53 62 64 90
![Page 50: 01 - 01 January - Sorting](https://reader033.vdocuments.site/reader033/viewer/2022042722/58a50ebb1a28ab8e1c8b56f9/html5/thumbnails/50.jpg)
21
25 32 41 55 63 72
10
22 45 53 62 64 90
![Page 51: 01 - 01 January - Sorting](https://reader033.vdocuments.site/reader033/viewer/2022042722/58a50ebb1a28ab8e1c8b56f9/html5/thumbnails/51.jpg)
21
25 32 41 55 63 72
10 22
45 53 62 64 90
![Page 52: 01 - 01 January - Sorting](https://reader033.vdocuments.site/reader033/viewer/2022042722/58a50ebb1a28ab8e1c8b56f9/html5/thumbnails/52.jpg)
21 25
32 41 55 63 72
10 22
45 53 62 64 90
![Page 53: 01 - 01 January - Sorting](https://reader033.vdocuments.site/reader033/viewer/2022042722/58a50ebb1a28ab8e1c8b56f9/html5/thumbnails/53.jpg)
21 25 32
41 55 63 72
10 22
45 53 62 64 90
![Page 54: 01 - 01 January - Sorting](https://reader033.vdocuments.site/reader033/viewer/2022042722/58a50ebb1a28ab8e1c8b56f9/html5/thumbnails/54.jpg)
21 25 32 41
55 63 72
10 22
45 53 62 64 90
![Page 55: 01 - 01 January - Sorting](https://reader033.vdocuments.site/reader033/viewer/2022042722/58a50ebb1a28ab8e1c8b56f9/html5/thumbnails/55.jpg)
21 25 32 41
55 63 72
10 22 45
53 62 64 90
![Page 56: 01 - 01 January - Sorting](https://reader033.vdocuments.site/reader033/viewer/2022042722/58a50ebb1a28ab8e1c8b56f9/html5/thumbnails/56.jpg)
21 25 32 41
55 63 72
10 22 45
53
62 64 90
![Page 57: 01 - 01 January - Sorting](https://reader033.vdocuments.site/reader033/viewer/2022042722/58a50ebb1a28ab8e1c8b56f9/html5/thumbnails/57.jpg)
21 25 32 41
55 63 72
10 22 45
53 62 64 90
![Page 58: 01 - 01 January - Sorting](https://reader033.vdocuments.site/reader033/viewer/2022042722/58a50ebb1a28ab8e1c8b56f9/html5/thumbnails/58.jpg)
![Page 59: 01 - 01 January - Sorting](https://reader033.vdocuments.site/reader033/viewer/2022042722/58a50ebb1a28ab8e1c8b56f9/html5/thumbnails/59.jpg)
![Page 60: 01 - 01 January - Sorting](https://reader033.vdocuments.site/reader033/viewer/2022042722/58a50ebb1a28ab8e1c8b56f9/html5/thumbnails/60.jpg)
![Page 61: 01 - 01 January - Sorting](https://reader033.vdocuments.site/reader033/viewer/2022042722/58a50ebb1a28ab8e1c8b56f9/html5/thumbnails/61.jpg)
![Page 62: 01 - 01 January - Sorting](https://reader033.vdocuments.site/reader033/viewer/2022042722/58a50ebb1a28ab8e1c8b56f9/html5/thumbnails/62.jpg)
![Page 63: 01 - 01 January - Sorting](https://reader033.vdocuments.site/reader033/viewer/2022042722/58a50ebb1a28ab8e1c8b56f9/html5/thumbnails/63.jpg)
Merging two sorted arrays of length n each takes O(n) comparisons.
![Page 64: 01 - 01 January - Sorting](https://reader033.vdocuments.site/reader033/viewer/2022042722/58a50ebb1a28ab8e1c8b56f9/html5/thumbnails/64.jpg)
![Page 65: 01 - 01 January - Sorting](https://reader033.vdocuments.site/reader033/viewer/2022042722/58a50ebb1a28ab8e1c8b56f9/html5/thumbnails/65.jpg)
![Page 66: 01 - 01 January - Sorting](https://reader033.vdocuments.site/reader033/viewer/2022042722/58a50ebb1a28ab8e1c8b56f9/html5/thumbnails/66.jpg)
![Page 67: 01 - 01 January - Sorting](https://reader033.vdocuments.site/reader033/viewer/2022042722/58a50ebb1a28ab8e1c8b56f9/html5/thumbnails/67.jpg)
![Page 68: 01 - 01 January - Sorting](https://reader033.vdocuments.site/reader033/viewer/2022042722/58a50ebb1a28ab8e1c8b56f9/html5/thumbnails/68.jpg)
![Page 69: 01 - 01 January - Sorting](https://reader033.vdocuments.site/reader033/viewer/2022042722/58a50ebb1a28ab8e1c8b56f9/html5/thumbnails/69.jpg)
![Page 70: 01 - 01 January - Sorting](https://reader033.vdocuments.site/reader033/viewer/2022042722/58a50ebb1a28ab8e1c8b56f9/html5/thumbnails/70.jpg)
![Page 71: 01 - 01 January - Sorting](https://reader033.vdocuments.site/reader033/viewer/2022042722/58a50ebb1a28ab8e1c8b56f9/html5/thumbnails/71.jpg)
![Page 72: 01 - 01 January - Sorting](https://reader033.vdocuments.site/reader033/viewer/2022042722/58a50ebb1a28ab8e1c8b56f9/html5/thumbnails/72.jpg)
![Page 73: 01 - 01 January - Sorting](https://reader033.vdocuments.site/reader033/viewer/2022042722/58a50ebb1a28ab8e1c8b56f9/html5/thumbnails/73.jpg)
![Page 74: 01 - 01 January - Sorting](https://reader033.vdocuments.site/reader033/viewer/2022042722/58a50ebb1a28ab8e1c8b56f9/html5/thumbnails/74.jpg)
![Page 75: 01 - 01 January - Sorting](https://reader033.vdocuments.site/reader033/viewer/2022042722/58a50ebb1a28ab8e1c8b56f9/html5/thumbnails/75.jpg)
![Page 76: 01 - 01 January - Sorting](https://reader033.vdocuments.site/reader033/viewer/2022042722/58a50ebb1a28ab8e1c8b56f9/html5/thumbnails/76.jpg)
![Page 77: 01 - 01 January - Sorting](https://reader033.vdocuments.site/reader033/viewer/2022042722/58a50ebb1a28ab8e1c8b56f9/html5/thumbnails/77.jpg)
![Page 78: 01 - 01 January - Sorting](https://reader033.vdocuments.site/reader033/viewer/2022042722/58a50ebb1a28ab8e1c8b56f9/html5/thumbnails/78.jpg)
![Page 79: 01 - 01 January - Sorting](https://reader033.vdocuments.site/reader033/viewer/2022042722/58a50ebb1a28ab8e1c8b56f9/html5/thumbnails/79.jpg)
![Page 80: 01 - 01 January - Sorting](https://reader033.vdocuments.site/reader033/viewer/2022042722/58a50ebb1a28ab8e1c8b56f9/html5/thumbnails/80.jpg)
![Page 81: 01 - 01 January - Sorting](https://reader033.vdocuments.site/reader033/viewer/2022042722/58a50ebb1a28ab8e1c8b56f9/html5/thumbnails/81.jpg)
![Page 82: 01 - 01 January - Sorting](https://reader033.vdocuments.site/reader033/viewer/2022042722/58a50ebb1a28ab8e1c8b56f9/html5/thumbnails/82.jpg)
![Page 83: 01 - 01 January - Sorting](https://reader033.vdocuments.site/reader033/viewer/2022042722/58a50ebb1a28ab8e1c8b56f9/html5/thumbnails/83.jpg)
![Page 84: 01 - 01 January - Sorting](https://reader033.vdocuments.site/reader033/viewer/2022042722/58a50ebb1a28ab8e1c8b56f9/html5/thumbnails/84.jpg)
![Page 85: 01 - 01 January - Sorting](https://reader033.vdocuments.site/reader033/viewer/2022042722/58a50ebb1a28ab8e1c8b56f9/html5/thumbnails/85.jpg)
![Page 86: 01 - 01 January - Sorting](https://reader033.vdocuments.site/reader033/viewer/2022042722/58a50ebb1a28ab8e1c8b56f9/html5/thumbnails/86.jpg)
![Page 87: 01 - 01 January - Sorting](https://reader033.vdocuments.site/reader033/viewer/2022042722/58a50ebb1a28ab8e1c8b56f9/html5/thumbnails/87.jpg)
![Page 88: 01 - 01 January - Sorting](https://reader033.vdocuments.site/reader033/viewer/2022042722/58a50ebb1a28ab8e1c8b56f9/html5/thumbnails/88.jpg)
![Page 89: 01 - 01 January - Sorting](https://reader033.vdocuments.site/reader033/viewer/2022042722/58a50ebb1a28ab8e1c8b56f9/html5/thumbnails/89.jpg)
![Page 90: 01 - 01 January - Sorting](https://reader033.vdocuments.site/reader033/viewer/2022042722/58a50ebb1a28ab8e1c8b56f9/html5/thumbnails/90.jpg)
![Page 91: 01 - 01 January - Sorting](https://reader033.vdocuments.site/reader033/viewer/2022042722/58a50ebb1a28ab8e1c8b56f9/html5/thumbnails/91.jpg)
![Page 92: 01 - 01 January - Sorting](https://reader033.vdocuments.site/reader033/viewer/2022042722/58a50ebb1a28ab8e1c8b56f9/html5/thumbnails/92.jpg)
![Page 93: 01 - 01 January - Sorting](https://reader033.vdocuments.site/reader033/viewer/2022042722/58a50ebb1a28ab8e1c8b56f9/html5/thumbnails/93.jpg)
There are log n layers of recursion.
![Page 94: 01 - 01 January - Sorting](https://reader033.vdocuments.site/reader033/viewer/2022042722/58a50ebb1a28ab8e1c8b56f9/html5/thumbnails/94.jpg)
There are log n layers of recursion.
The work done at each layer is O(n).
![Page 95: 01 - 01 January - Sorting](https://reader033.vdocuments.site/reader033/viewer/2022042722/58a50ebb1a28ab8e1c8b56f9/html5/thumbnails/95.jpg)
There are log n layers of recursion.
The work done at each layer is O(n).
Total time spent is O(n log n).
![Page 96: 01 - 01 January - Sorting](https://reader033.vdocuments.site/reader033/viewer/2022042722/58a50ebb1a28ab8e1c8b56f9/html5/thumbnails/96.jpg)
Merge Sort
![Page 97: 01 - 01 January - Sorting](https://reader033.vdocuments.site/reader033/viewer/2022042722/58a50ebb1a28ab8e1c8b56f9/html5/thumbnails/97.jpg)
![Page 98: 01 - 01 January - Sorting](https://reader033.vdocuments.site/reader033/viewer/2022042722/58a50ebb1a28ab8e1c8b56f9/html5/thumbnails/98.jpg)
Pick a “pivot”.
![Page 99: 01 - 01 January - Sorting](https://reader033.vdocuments.site/reader033/viewer/2022042722/58a50ebb1a28ab8e1c8b56f9/html5/thumbnails/99.jpg)
Pick a “pivot”.
![Page 100: 01 - 01 January - Sorting](https://reader033.vdocuments.site/reader033/viewer/2022042722/58a50ebb1a28ab8e1c8b56f9/html5/thumbnails/100.jpg)
![Page 101: 01 - 01 January - Sorting](https://reader033.vdocuments.site/reader033/viewer/2022042722/58a50ebb1a28ab8e1c8b56f9/html5/thumbnails/101.jpg)
Recurse!
![Page 102: 01 - 01 January - Sorting](https://reader033.vdocuments.site/reader033/viewer/2022042722/58a50ebb1a28ab8e1c8b56f9/html5/thumbnails/102.jpg)
![Page 103: 01 - 01 January - Sorting](https://reader033.vdocuments.site/reader033/viewer/2022042722/58a50ebb1a28ab8e1c8b56f9/html5/thumbnails/103.jpg)
“Merging” is trivial.
![Page 104: 01 - 01 January - Sorting](https://reader033.vdocuments.site/reader033/viewer/2022042722/58a50ebb1a28ab8e1c8b56f9/html5/thumbnails/104.jpg)
![Page 105: 01 - 01 January - Sorting](https://reader033.vdocuments.site/reader033/viewer/2022042722/58a50ebb1a28ab8e1c8b56f9/html5/thumbnails/105.jpg)
![Page 106: 01 - 01 January - Sorting](https://reader033.vdocuments.site/reader033/viewer/2022042722/58a50ebb1a28ab8e1c8b56f9/html5/thumbnails/106.jpg)
![Page 107: 01 - 01 January - Sorting](https://reader033.vdocuments.site/reader033/viewer/2022042722/58a50ebb1a28ab8e1c8b56f9/html5/thumbnails/107.jpg)
The recursion tree may be very skewed.
![Page 108: 01 - 01 January - Sorting](https://reader033.vdocuments.site/reader033/viewer/2022042722/58a50ebb1a28ab8e1c8b56f9/html5/thumbnails/108.jpg)
Quick Sort
![Page 109: 01 - 01 January - Sorting](https://reader033.vdocuments.site/reader033/viewer/2022042722/58a50ebb1a28ab8e1c8b56f9/html5/thumbnails/109.jpg)
Sorting AlgorithmsCounting Sort
Bubble Sort
Merge Sort
Quick Sort
Insertion Sort
O(n + k)
O(n2)
O(n log n)
O(n2)
O(n2)
![Page 110: 01 - 01 January - Sorting](https://reader033.vdocuments.site/reader033/viewer/2022042722/58a50ebb1a28ab8e1c8b56f9/html5/thumbnails/110.jpg)
Sorting AlgorithmsCounting Sort
Bubble Sort
Merge Sort
Quick Sort
Insertion SortBinary
O(n + k)
O(n2)
O(n log n)
O(n2)
O(n2)
![Page 111: 01 - 01 January - Sorting](https://reader033.vdocuments.site/reader033/viewer/2022042722/58a50ebb1a28ab8e1c8b56f9/html5/thumbnails/111.jpg)
Sorting AlgorithmsCounting Sort
Bubble Sort
Merge Sort
Quick Sort
Insertion SortBinary
Randomised
O(n + k)
O(n2)
O(n log n)
O(n2)
O(n2)
![Page 112: 01 - 01 January - Sorting](https://reader033.vdocuments.site/reader033/viewer/2022042722/58a50ebb1a28ab8e1c8b56f9/html5/thumbnails/112.jpg)
References
![Page 113: 01 - 01 January - Sorting](https://reader033.vdocuments.site/reader033/viewer/2022042722/58a50ebb1a28ab8e1c8b56f9/html5/thumbnails/113.jpg)
References
Look up “The Sound of Sorting” on Youtube.
![Page 114: 01 - 01 January - Sorting](https://reader033.vdocuments.site/reader033/viewer/2022042722/58a50ebb1a28ab8e1c8b56f9/html5/thumbnails/114.jpg)
References
Look up “The Sound of Sorting” on Youtube.
http://www.sorting-algorithms.com
![Page 115: 01 - 01 January - Sorting](https://reader033.vdocuments.site/reader033/viewer/2022042722/58a50ebb1a28ab8e1c8b56f9/html5/thumbnails/115.jpg)
Agenda
Sorting Algorithms
Lower Bounds
Preference Aggregation
![Page 116: 01 - 01 January - Sorting](https://reader033.vdocuments.site/reader033/viewer/2022042722/58a50ebb1a28ab8e1c8b56f9/html5/thumbnails/116.jpg)
![Page 117: 01 - 01 January - Sorting](https://reader033.vdocuments.site/reader033/viewer/2022042722/58a50ebb1a28ab8e1c8b56f9/html5/thumbnails/117.jpg)
Happy New Year