GOAL of algorithm
goal:—-communication
- solve compucating problems
- prove correctness
- argue efficiency
Algorithms and computation
problems:
discrete mathematics 离散数学
Inputs—-outputs
…. ….general problems arbitrary inputs
Exp: for birthday problems -maintain record
interview every student
procedure - algorithms
Correct:induction -归纳法 -就职 引起
-base case 0 1… K=0
assumeEffeciency -asymptotic analysis渐进分析
O()———- upper bound
Omega()——lower bounds
Theta()——-both
Model of computation
Word - RAM :world - chunk- 64 bits
one read from mem
store that address in CPU
2-32 —-4 GB——Limitation
64 bits —-20 exabytes
学习顺序
Data structures and sorting—-> shortest paths, algorithms, and graphs——> dynamic programming