- 17
- 0
- 约1.07万字
- 约 23页
- 2016-03-09 发布于广东
- 举报
6.006
Introduction to Algorithms
Lecture 2: Peak Finding
Prof. Erik Demaine
Today
• Peak finding (new problem)
– 1D algorithms
– 2D algorithms
• Divide conquer (new technique)
Finding Water…
IN SPACE
• You are GeordiLaForge
• Trapped on alien mountain range
• Need to find a pool where water
accumulates
• Can teleport, but can’t see /wiki/File:GeordiLaForge.jpg
photo by Erik Demaine Banff, Canada
Finding Water…
IN SPACE
• Problem:Find a local minimum or maximum
in a terrain by sampling
photo by Erik Demaine Banff, Canada
1D Peak Finding
• Given an array :
: 1 2 6 5 3 7 4
0 1 2 3 4 5 6
• is a peak if it is not smaller than its
neighbor(s):
where we imagine
• Goal:Find any peak
“Brute Force” Algorithm
• Test all elements for peakyness
for in :
if :
return
: 1 2 6 5 3 7 4
0 1 2 3 4 5 6
Algorithm 1½
•
– Global maximum is alocal maximum
for in :
if :
return
: 1 2 6 5 3 7 4
0 1 2 3 4 5 6
Cleverer Ide
您可能关注的文档
- Primary Teachers’ Perceptions of Their Knowledge and.pdf
- Primeras Políticas de first housing Policies in sPain and.pdf
- Primers and polymerase chain reaction conditions for DNA.pdf
- Principal Differences in Structure-Mapping.pdf
- Principios bioéticos en salud pública limitaciones strongystrong pro p u.pdf
- Principles for strongEconomic Recoverystrong and Renewal.pdf
- Principles of Gestalt Psychology.pdf
- Principles of strongPolitical Economystrong - American University.pdf
- Principles of strongPolitical Economystrong Applied to Policy and.pdf
- Principles of strongUstrong.S. Family Law.pdf
- 2026年中国直联旋片式真空泵行业市场数据调查、监测研究报告.docx
- 2026年中国内花绞胶圈行业市场数据调查、监测研究报告.docx
- 2026年中国白色聚酯绝缘漆行业市场数据调查、监测研究报告.docx
- 2025年事业单位笔试-安徽-安徽中医外科学(医疗招聘)历年参考题典型考点含答案解析.docx
- 2026年中国铁轮行业市场数据调查、监测研究报告.docx
- 2026年中国炸篮行业市场数据调查、监测研究报告.docx
- 2026年中国超高磷闸瓦行业市场数据调查、监测研究报告.docx
- 2026年中国光电缆防鸟啄保护套行业市场数据调查、监测研究报告.docx
- 2026年中国单头吸塑打板机行业市场数据调查、监测研究报告.docx
- 2026年中国液晶屏显示液压万能试验机行业市场数据调查、监测研究报告.docx
最近下载
- 【精美】药学服务与药患沟通技能讲座PPT课件.pptx VIP
- 风力发电场电气设计.pptx VIP
- 2025年度“六个方面”组织生活会六个方面的对照检查材料.docx VIP
- 【低空经济】市低空经济产业发展行动方案编制.docx VIP
- 11J508 建筑玻璃应用构造-栏板 隔断 地板 吊顶 水下玻璃 挡烟垂壁.pdf VIP
- DB32∕T 2677-2014 公路涉路工程安全影响评价报告编制标准.docx VIP
- 2026中国农业科学院第一批招聘(中国农业科学院农产品加工研究所)考试冲刺试题及答案解析.docx VIP
- 铁路隧道渗漏水病害整治施工方案.doc
- 《电力企业合规管理体系有效性评价指南》编制说明.pdf VIP
- 酒店保洁服务整体投标方案(技术方案).doc
原创力文档

文档评论(0)