## Slide 1

### Slide 1 text

"Sorting" <=> "Rubyists"

No content

1000

1000 = 30

1000 = 30

No content

..

..

Algorithms

## Slide 10

### Slide 10 text

A series of step-by-step instructions

t

No content

:14

Big O

No content

No content

## Slide 17

### Slide 17 text

0 2 4 6 8 10 0 1 2 3 4 5 6 7 8 9 10 O(n) n

No content

## Slide 19

### Slide 19 text

0 2 4 6 8 10 0 1 2 3 4 5 6 7 8 9 10 O (log n )

## Slide 20

### Slide 20 text

0 250 500 750 1000 1 4 7 10 13 16 19 22 25 28 31 34 37 40 43 46 49 52 55 58 61 64 67 70 73 76 79 82 85 88 91 94 97 100 O(n) O(1) O(log n) O(n log n) O(n^2) O(2^n) O(n!)

## Slide 21

### Slide 21 text

0 25 50 75 100 1 4 7 10 13 16 19 22 25 28 31 34 37 40 43 46 49 52 55 58 61 64 67 70 73 76 79 82 85 88 91 94 97 100 O(n) O(1) O(log n) O(n log n) O(n^2) O(2^n) O(n!)

## Slide 22

### Slide 22 text

When do you update a user record?

## Slide 23

### Slide 23 text

When do you update a user record? O ( n log n )

## Slide 24

### Slide 24 text

If you understood everything

## Slide 25

### Slide 25 text

If you understood everything I’m really it today O(n)

## Slide 26

### Slide 26 text

How do you debug an app?

## Slide 27

### Slide 27 text

How do you debug an app? Start O (log n )

## Slide 28

### Slide 28 text

What happens when you buy something?

## Slide 29

### Slide 29 text

What happens when you buy something? You it O(n)

Big Ω

Bubble Sort

## Slide 32

### Slide 32 text

!"#"\$"%"&"'"(")"*"+",

## Slide 33

### Slide 33 text

!"#"\$"%"&"'"(")"*"+",

## Slide 34

### Slide 34 text

!"#"\$"%"&"'"(")"*"+",

## Slide 35

### Slide 35 text

!"\$"#"%"&"'"(")"*"+",

## Slide 36

### Slide 36 text

!"\$"#"%"&"'"(")"*"+",

## Slide 37

### Slide 37 text

!"\$"%"#"&"'"(")"*"+",

## Slide 38

### Slide 38 text

!"\$"%"#"&"'"(")"*"+",

## Slide 39

### Slide 39 text

!"\$"%"&"#"'"(")"*"+",

## Slide 40

### Slide 40 text

!"\$"%"&"#"'"(")"*"+",

## Slide 41

### Slide 41 text

!"\$"%"&"'"#"(")"*"+",

## Slide 42

### Slide 42 text

!"\$"%"&"'"#"(")"*"+",

## Slide 43

### Slide 43 text

!"\$"%"&"'"("#")"*"+",

## Slide 44

### Slide 44 text

!"\$"%"&"'"("#")"*"+",

## Slide 45

### Slide 45 text

!"\$"%"&"'"(")"#"*"+",

## Slide 46

### Slide 46 text

!"\$"%"&"'"(")"#"*"+",

## Slide 47

### Slide 47 text

!"\$"%"&"'"(")"*"#"+",

## Slide 48

### Slide 48 text

!"\$"%"&"'"(")"*"#"+",

## Slide 49

### Slide 49 text

!"\$"%"&"'"(")"*"+"#",

## Slide 50

### Slide 50 text

!"\$"%"&"'"(")"*"+"#",

## Slide 51

### Slide 51 text

!"\$"%"&"'"(")"*"+"#",

## Slide 52

### Slide 52 text

!"\$"%"&"'"(")"*"+"#",

## Slide 53

### Slide 53 text

!"\$"%"&"'"(")"*"+"#",

## Slide 54

### Slide 54 text

!"%"\$"&"'"(")"*"+"#",

## Slide 55

### Slide 55 text

!"%"\$"&"'"(")"*"+"#",

## Slide 56

### Slide 56 text

!"%"&"\$"'"(")"*"+"#",

## Slide 57

### Slide 57 text

!"%"&"\$"'"(")"*"+"#",

## Slide 58

### Slide 58 text

!"%"&"'"\$"(")"*"+"#",

## Slide 59

### Slide 59 text

!"%"&"'"\$"(")"*"+"#",

## Slide 60

### Slide 60 text

!"%"&"'"("\$")"*"+"#",

## Slide 61

### Slide 61 text

!"%"&"'"("\$")"*"+"#",

## Slide 62

### Slide 62 text

!"%"&"'"(")"\$"*"+"#",

## Slide 63

### Slide 63 text

!"%"&"'"(")"\$"*"+"#",

## Slide 64

### Slide 64 text

!"%"&"'"(")"*"\$"+"#",

## Slide 65

### Slide 65 text

!"%"&"'"(")"*"\$"+"#",

## Slide 66

### Slide 66 text

!"%"&"'"(")"*"+"\$"#",

## Slide 67

### Slide 67 text

!"%"&"'"(")"*"+"\$"#",

## Slide 68

### Slide 68 text

!"%"&"'"(")"*"+"\$"#",

## Slide 69

### Slide 69 text

!"%"&"'"(")"*"+"\$"#",

## Slide 70

### Slide 70 text

%"!"&"'"(")"*"+"\$"#",

## Slide 71

### Slide 71 text

%"!"&"'"(")"*"+"\$"#",

## Slide 72

### Slide 72 text

%"&"!"'"(")"*"+"\$"#",

## Slide 73

### Slide 73 text

%"&"!"'"(")"*"+"\$"#",

## Slide 74

### Slide 74 text

%"&"'"!"(")"*"+"\$"#",

## Slide 75

### Slide 75 text

%"&"'"!"(")"*"+"\$"#",

## Slide 76

### Slide 76 text

%"&"'"!"(")"*"+"\$"#",

## Slide 77

### Slide 77 text

%"&"'"!")"("*"+"\$"#",

## Slide 78

### Slide 78 text

%"&"'"!")"("*"+"\$"#",

## Slide 79

### Slide 79 text

%"&"'"!")"*"("+"\$"#",

## Slide 80

### Slide 80 text

%"&"'"!")"*"("+"\$"#",

## Slide 81

### Slide 81 text

%"&"'"!")"*"+"("\$"#",

## Slide 82

### Slide 82 text

%"&"'"!")"*"+"("\$"#",

## Slide 83

### Slide 83 text

%"&"'"!")"*"+"("\$"#",

## Slide 84

### Slide 84 text

%"&"'"!")"*"+"("\$"#",

## Slide 85

### Slide 85 text

%"&"'"!")"*"+"("\$"#",

## Slide 86

### Slide 86 text

%"&"'"!")"*"+"("\$"#",

## Slide 87

### Slide 87 text

%"&"'"!")"*"+"("\$"#",

## Slide 88

### Slide 88 text

%"&"'")"!"*"+"("\$"#",

## Slide 89

### Slide 89 text

%"&"'")"!"*"+"("\$"#",

## Slide 90

### Slide 90 text

%"&"'")"*"!"+"("\$"#",

## Slide 91

### Slide 91 text

%"&"'")"*"!"+"("\$"#",

## Slide 92

### Slide 92 text

%"&"'")"*"+"!"("\$"#",

## Slide 93

### Slide 93 text

%"&"'")"*"+"!"("\$"#",

## Slide 94

### Slide 94 text

%"&"'")"*"+"!"("\$"#",

## Slide 95

### Slide 95 text

%"&"'")"*"+"!"("\$"#",

## Slide 96

### Slide 96 text

%"&"'")"*"+"!"("\$"#",

## Slide 97

### Slide 97 text

%"&"'")"*"+"!"("\$"#",

## Slide 98

### Slide 98 text

%"&")"'"*"+"!"("\$"#",

## Slide 99

### Slide 99 text

%"&")"'"*"+"!"("\$"#",

## Slide 100

### Slide 100 text

%"&")"'"*"+"!"("\$"#",

## Slide 101

### Slide 101 text

%"&")"'"+"*"!"("\$"#",

## Slide 102

### Slide 102 text

%"&")"'"+"*"!"("\$"#",

## Slide 103

### Slide 103 text

%"&")"'"+"*"!"("\$"#",

## Slide 104

### Slide 104 text

%"&")"'"+"*"!"("\$"#",

## Slide 105

### Slide 105 text

%"&")"'"+"*"!"("\$"#",

## Slide 106

### Slide 106 text

%")"&"'"+"*"!"("\$"#",

## Slide 107

### Slide 107 text

%")"&"'"+"*"!"("\$"#",

## Slide 108

### Slide 108 text

%")"&"'"+"*"!"("\$"#",

## Slide 109

### Slide 109 text

%")"&"+"'"*"!"("\$"#",

## Slide 110

### Slide 110 text

%")"&"+"'"*"!"("\$"#",

## Slide 111

### Slide 111 text

%")"&"+"'"*"!"("\$"#",

## Slide 112

### Slide 112 text

%")"&"+"'"*"!"("\$"#",

## Slide 113

### Slide 113 text

)"%"&"+"'"*"!"("\$"#",

## Slide 114

### Slide 114 text

)"%"&"+"'"*"!"("\$"#",

## Slide 115

### Slide 115 text

)"%"&"+"'"*"!"("\$"#",

## Slide 116

### Slide 116 text

)"%"&"+"'"*"!"("\$"#",

## Slide 117

### Slide 117 text

)"%"&"+"'"*"!"("\$"#",

2) n O(

2) O(set.length

2) n O(

⌦(n)

## Slide 122

### Slide 122 text

0 250 500 750 1000 1 4 7 10 13 16 19 22 25 28 31 34 37 40 43 46 49 52 55 58 61 64 67 70 73 76 79 82 85 88 91 94 97 100 O(n) O(1) O(log n) O(n log n) O(n^2) O(2^n) O(n!)

## Slide 123

### Slide 123 text

https://www.toptal.com/developers/sorting-algorithms/bubble-sort Random Nearly Sorted Reversed Few Unique

## Slide 124

### Slide 124 text

https://www.toptal.com/developers/sorting-algorithms/bubble-sort Random Nearly Sorted Reversed Few Unique

Insertion Sort

## Slide 126

### Slide 126 text

("#","&"+"%"-"*"\$"'"!

## Slide 127

### Slide 127 text

("#","&"+"%"-"*"\$"'"!

## Slide 128

### Slide 128 text

("#","&"+"%"-"*"\$"'"!

## Slide 129

### Slide 129 text

("#","&"+"%"-"*"\$"'"!

## Slide 130

### Slide 130 text

("#","&"+"%"-"*"\$"'"!

## Slide 131

### Slide 131 text

("#","&"+"%"-"*"\$"'"!

## Slide 132

### Slide 132 text

("#","&"+"%"-"*"\$"'"!

## Slide 133

### Slide 133 text

("#","&"+"%"-"*"\$"'"!

## Slide 134

### Slide 134 text

("#","&"+"%"-"*"\$"'"!

## Slide 135

### Slide 135 text

("#","&"+"%"-"*"\$"'"!

## Slide 136

### Slide 136 text

("#","&"+"%"-"*"\$"'"!

## Slide 137

### Slide 137 text

&"("#","+"%"-"*"\$"'"!

## Slide 138

### Slide 138 text

&"("#","+"%"-"*"\$"'"!

## Slide 139

### Slide 139 text

&"("#","+"%"-"*"\$"'"!

## Slide 140

### Slide 140 text

&"("#","+"%"-"*"\$"'"!

## Slide 141

### Slide 141 text

&"("#","+"%"-"*"\$"'"!

## Slide 142

### Slide 142 text

&"("#","+"%"-"*"\$"'"!

## Slide 143

### Slide 143 text

&"+"("#","%"-"*"\$"'"!

## Slide 144

### Slide 144 text

&"+"("#","%"-"*"\$"'"!

## Slide 145

### Slide 145 text

&"+"("#","%"-"*"\$"'"!

## Slide 146

### Slide 146 text

&"+"("#","%"-"*"\$"'"!

## Slide 147

### Slide 147 text

&"+"("#","%"-"*"\$"'"!

## Slide 148

### Slide 148 text

&"+"("#","%"-"*"\$"'"!

## Slide 149

### Slide 149 text

&"+"("#","%"-"*"\$"'"!

## Slide 150

### Slide 150 text

%"&"+"("#","-"*"\$"'"!

## Slide 151

### Slide 151 text

%"&"+"("#","-"*"\$"'"!

## Slide 152

### Slide 152 text

%"&"+"("#","-"*"\$"'"!

## Slide 153

### Slide 153 text

%"&"+"("#","-"*"\$"'"!

## Slide 154

### Slide 154 text

%"&"+"("#","-"*"\$"'"!

## Slide 155

### Slide 155 text

%"&"+"("#","-"*"\$"'"!

## Slide 156

### Slide 156 text

%"&"+"("#","-"*"\$"'"!

## Slide 157

### Slide 157 text

%"&"+"("#","-"*"\$"'"!

## Slide 158

### Slide 158 text

-"%"&"+"("#","*"\$"'"!

## Slide 159

### Slide 159 text

-"%"&"+"("#","*"\$"'"!

## Slide 160

### Slide 160 text

-"%"&"+"("#","*"\$"'"!

## Slide 161

### Slide 161 text

-"%"&"+"("#","*"\$"'"!

## Slide 162

### Slide 162 text

-"%"&"+"("#","*"\$"'"!

## Slide 163

### Slide 163 text

-"%"&"+"("#","*"\$"'"!

## Slide 164

### Slide 164 text

-"%"&"+"*"("#","\$"'"!

## Slide 165

### Slide 165 text

-"%"&"+"*"("#","\$"'"!

## Slide 166

### Slide 166 text

-"%"&"+"*"("#","\$"'"!

## Slide 167

### Slide 167 text

-"%"&"+"*"("#","\$"'"!

## Slide 168

### Slide 168 text

-"%"&"+"*"("#","\$"'"!

## Slide 169

### Slide 169 text

-"%"&"+"*"("\$"#","'"!

## Slide 170

### Slide 170 text

-"%"&"+"*"("\$"#","'"!

## Slide 171

### Slide 171 text

-"%"&"+"*"("\$"#","'"!

## Slide 172

### Slide 172 text

-"%"&"+"*"("\$"#","'"!

## Slide 173

### Slide 173 text

-"%"&"+"*"("\$"#","'"!

## Slide 174

### Slide 174 text

-"%"&"+"*"("\$"#","'"!

## Slide 175

### Slide 175 text

-"%"&"+"*"("\$"#","'"!

## Slide 176

### Slide 176 text

-"%"&"+"*"("\$"#","'"!

## Slide 177

### Slide 177 text

-"%"&"+"'"*"("\$"#","!

## Slide 178

### Slide 178 text

-"%"&"+"'"*"("\$"#","!

## Slide 179

### Slide 179 text

-"%"&"+"'"*"("\$"#","!

## Slide 180

### Slide 180 text

-"%"&"+"'"*"("\$"#","!

## Slide 181

### Slide 181 text

-"%"&"+"'"*"("\$"#","!

## Slide 182

### Slide 182 text

-"%"&"+"'"*"("\$"#","!

## Slide 183

### Slide 183 text

-"%"&"+"'"*"("\$"#","!

## Slide 184

### Slide 184 text

-"%"&"+"'"*"!"("\$"#",

## Slide 185

### Slide 185 text

-"%"&"+"'"*"!"("\$"#",

2) n O(

⌦(n)

## Slide 188

### Slide 188 text

https://www.toptal.com/developers/sorting-algorithms/insertion-sort Random Nearly Sorted Reversed Few Unique

## Slide 189

### Slide 189 text

https://www.toptal.com/developers/sorting-algorithms/insertion-sort Random Nearly Sorted Reversed Few Unique

Quicksort

## Slide 191

### Slide 191 text

#"-"%"'"&","("\$"!"*"+

## Slide 192

### Slide 192 text

#"-"%"'"&","("\$"!"*"+

## Slide 193

### Slide 193 text

#"-"%"'"&"("\$"!"*"+",

## Slide 194

### Slide 194 text

#"-"%"'"&"("\$"!"*"+",

## Slide 195

### Slide 195 text

-"%"'"&"!"*"+"("#"\$",

## Slide 196

### Slide 196 text

-"%"'"&"!"*"+"("#"\$",

## Slide 197

### Slide 197 text

-"%"&"'"!"*"+"("#"\$",

## Slide 198

### Slide 198 text

-"%"&"'"!"*"+"("#"\$",

## Slide 199

### Slide 199 text

-"%"&"'"!"*"+"("#"\$",

## Slide 200

### Slide 200 text

-"%"&"'"!"*"+"("#"\$",

## Slide 201

### Slide 201 text

-"%"&"'"+"*"!"("#"\$",

## Slide 202

### Slide 202 text

-"%"&"'"+"*"!"("#"\$",

## Slide 203

### Slide 203 text

-"%"&"+"'"*"!"("#"\$",

## Slide 204

### Slide 204 text

-"%"&"+"'"*"!"("#"\$",

## Slide 205

### Slide 205 text

-"%"&"+"'"*"!"("\$"#",

## Slide 206

### Slide 206 text

-"%"&"+"'"*"!"("\$"#",

## Slide 207

### Slide 207 text

-"%"&"+"'"*"!"("\$"#",

## Slide 208

### Slide 208 text

-"%"&"+"'"*"!"("\$"#",

## Slide 209

### Slide 209 text

-"%"&"+"'"*"!"("\$"#",

## Slide 210

### Slide 210 text

-"%"&"+"'"*"!"("\$"#",

2) n O(

## Slide 212

### Slide 212 text

#"-"%"'"&","("\$"!"*"+

## Slide 213

### Slide 213 text

#"-"%"'"&"("\$"!"*"+",

O ( n log n )

⌦( n log n )

## Slide 216

### Slide 216 text

https://www.toptal.com/developers/sorting-algorithms/quick-sort Random Nearly Sorted Reversed Few Unique

## Slide 217

### Slide 217 text

https://www.toptal.com/developers/sorting-algorithms/quick-sort Random Nearly Sorted Reversed Few Unique

## Slide 218

### Slide 218 text

Bubble Random Nearly Sorted Reversed Few Unique Insertion Quick

## Slide 219

### Slide 219 text

Bubble Random Nearly Sorted Reversed Few Unique Insertion Quick

No content

No content

No content

No content

No content

Gracias.

## Slide 226

### Slide 226 text

Bibliography • Pollice, G., Selkow, S., Heineman, G.T. (2008). Algorithms in a Nutshell. O’Reilly Media, Inc. • Bhargava, A. (2016). Grokking Algorithms. Manning Publications. • du Sautoy, M. (Presenter), Overton, P. (Producer). (2015, September 24). The Secret Rules of Modern Living: Algorithms [Television broadcast]. London, UK: BBC Four. • Yukihiro, M. (1996). Array.sort!. Ruby [Software]. Retrieved 2017, March 27 from https://github.com/ruby/ruby/blob/ 47563655037ed453607de33b86fcc094878769ac/ array.c#L2431-L2513.

## Slide 227

### Slide 227 text

Images • Toptal. (2010). [Sorting Algorithms Animations]. Retrieved March 26, 2017, from https://www.toptal.com/developers/sorting-algorithms • Cortesi, A. (2010). [sorting algorithm visualization]. Retrieved March 26, 2017, from http://sortvis.org/ • http://chocolate.wikia.com/wiki/Chocolate_Chip_Cookie • https://www.babble.com/best-recipes/anatomy-of-a-chocolate-chip-cookie/ • http://thequotablekitchen.com/thick-chewy-chocolate-chip-cookies/ • http://www.beachwoodreporter.com/tv/what_i_watched_last_night_55.php • http://asegrad.tufts.edu/academics/explore-graduate-programs/computer- science

## Slide 228

### Slide 228 text

Funography • https://www.youtube.com/watch?v=kPRA0W1kECg • https://www.youtube.com/watch?v=gOKVwRIyWdg • Big O and Big Omega graphics: https://texblog.org/ 2014/06/24/big-o-and-related-notations-in-latex/