238
average case vs.
worst case
68–71
exercises 72
merge sort vs. quicksort 67–68
R
random access 30
recommendations system,
building
189–194
recursion 37–49
base
case and recursive case
40–41
call stack with 45–50
overview 37–39
regression 196
resizing 91
run time
common run times 15–16
growth
of at different rates
11–13
overview 10
S
searches
binary search 3–10
as better way to search 5–7
exercises 6–9
overview 3–4
running time 10
breadth-first
search
graphs and 99–104
implementing 105–106
implementing
algorithm
107–113
selection sort 32–33
sequential access 30
set-covering problem 146–151
approximation
algorithms
calculating answer 149
code for setup 147–148
sets 149–150
exercise 152
overview 146
set difference 150
set intersection 150
sets 148
set union 150
SHA algorithms 213–216
checking passwords 215–216
comparing files 214
overview 213
SHA (Secure Hash Algorithm)
function 92, 214
shortest path 98, 128
signals, processing 207
Simhash 216, 217
simple search 5, 11, 200
SQL query 209
stacks 42–49
call stack 43–45
call stack with recursion 45–50
exercise 45, 49–50
overview 42
states_covered set 149
states_for_station 151
states_needed 151
stock market, predicting 201
strings, mapping to numbers 76
sum function 57, 59
Dostları ilə paylaş: