MIT 算法导论公开课笔记——分而治之——寻峰器(peak finder)
Efficient programmer
Scalability可伸缩性
Classic data structures
Modules 模块
Trees 树sorting排序一万亿个数字
复杂性
RSA加密 SLL
Graphs 图最基本的数据结构:魔方任务
使用特定算法编码
最短路径问题
Advanced topics
一个具体问题:
Peak finder:一维
a |
b |
c |
d |
e |
f |
g |
h |
i |
1 2 3 4 5 6 7 8 9
Peak:高峰——position 2 is a peak if and only if b>=a and b>=c;position 9 is a peak iff i>=h;
Problem:find a peak if it is exists;
Straightforward algorithm 简单的算法
Start from left:
|
|
|
|
|
…………… |
|
………… |
|
< |