- 4
- 0
- 约2.13千字
- 约 6页
- 2017-02-04 发布于天津
- 举报
2009-2010第一学期算法基础试题答案(参考)
2009-2010第一学期算法基础试题答案(参考)
基本题
a. 方法一(极限法)
证明:
b. 方法二(定义法)
证明:
解:1)
2)
3)
解:主定理case 1
解:主定理case 3
计算题
过程如下:
最长公共子序列为:2 0 1 1 2 或 2 0 1 0 1或1 0 1 1 2
或2 1 0 1 2或 1 0 1 0 2
最长公共子序列长度为 5 。
编码树如下:
A:0 0 2 B:0 2 C:1 2 D:2
E:1 0 F:0 0 1 G:1 1 H:0 1 最优:102/56
最小生成树:
总权值为:81
阅读并分析算法
解:
解:
序列 A A B C A A A B C A A A i 1 2 3 4 5 6 7 8 9 10 11 12 j 1 2 1 1 2 3 3 4 5 6 7 8 next 0 1 2 1 1 2 3 3 4 5 6 7 算法设计
解:
算法思想
按照题目的要求本题应该写出两个子过程,一个是Preprocessing,一个是Query。其中Preprocessing采用Counting Sort的思想实现,但只计数不排序,Query实现时需要注意边界问题。
伪码
解:
算法思想
根据题意,修改
您可能关注的文档
- 1.1从自然数到有理数同步训练.doc
- 105学年度台中市新社区福民国民小学代理教师暨教学支援人.doc
- 161321200169福建伟志工程勘测股份有限公司.doc
- 2.十佳海洋工程申报书-附件2.doc
- 2010年天水市初中毕业与升学学业考试(中考)试卷.doc
- 2013级数学与应用数学专业见习成绩表.doc
- 2016~2017学年度第一学期期末抽测.doc
- 2016年度通号中心华为交换机及配件.doc
- 2016年机自中心赛莱默水泵配件采购项目.doc
- 2017年上海高考化学综合测试(七).doc
- unidir -人工智能与国际安全:理解风险并为建立信任措施铺平道路 AI and International Security - Understanding the Risks and Paving the Path for Confidence-Building Measures.pdf
- unidir -通过负责任行为的规范、规则和原则推进空间安全的非洲视角 African Perspectives for Advancing Space Security Through Norms, Rules and Principles of Responsible Behaviours - Workshop Summary Report.pdf
- wfp -约旦学校供餐计划影响评估 Jordan, School Meal Programme Impact Evaluation.pdf
- wfp -注意差距 莱索托案例研究 Mind the Gap -Lesotho Case Study.pdf
- unesco -数字公共产品与新兴技术促进公平和包容的知识获取 Dubai Declaration on Open Educational Resources (OER) digital public goods and emerging technologies for equitable and inclusive access to knowledge.pdf
- unidir -致命自主武器系统领域新兴技术相关提案 Proposals Related to Emerging Technologies in the Area of Lethal Autonomous Weapons Systems- A Resource Paper (updated).pdf
- who -脊髓灰质炎过渡战略框架:监测与评估 Polio transition strategic framework - Monitoring and evaluation.pdf
- who -高效实用的结核病治疗试验平台会议报告 Platform for efficient and practical tuberculosis treatment trials.pdf
- unesco -国际性教育技术指导纲要:循证方法 International technical guidance on sexuality education - an evidence-informed approach.pdf
- UNIDIR_unidir -涉足浑浊之水:海底通信电缆与负责任的国家行为 Wading Murky Waters - Subsea Communications Cables and Responsible State Behaviour.pdf
原创力文档

文档评论(0)