版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、烟台大学计算机学院证明正确性分析算法设计程序理解问题精确解或近似解选择数据结构算法设计策略设计算法nIsizeITIp)()()(0limnbnan032! 3! 21iixixxxxexnnenx1limabbalogbaabcccloglog)(loganabnbloglogbaaccblogloglogaabblog)/1 (logbaablog1logacbbcaloglog.5432)1ln(5432xxxxxxxxxx)1ln(10loglim)2(loglimlogabnnabnnnn00)!1(1!nnnnnnn321!nennnn112!neennnn2!nnn1211121
2、)(!nnon )2(!nn)log() !log(nnnif (expression) statement;else statement; exp1?exp2:exp3 y= x9 ? 100:200; 等价于: if (x9) y=100; else y=200;switch (expression) case 1: statement sequence; break; case 2: statement sequence; break; default: statement sequence; return-type function name(para-list) body of th
3、e function int max(int x,int y) return xy?x:y; template Type max(Type x,Type y) return xy?x:y; int i=max(1,2);double x=max(1.0,2.0);template void Make2DArray(Type* &x,int rows, int cols) x=new Type*rows; for (int i=0;irows;i+) xi=new Typecols;template void Delete2DArray(Type* &x,int rows) for (int i
4、=0;irows;i+) delete xi; delete x; x=0;templateint seqSearch(Type *a, int n, Type k) for(int i=0;in;i+) if (ai=k) return i; return -1;nIsizeavgITIpnT)()()()(pnnpnnpnpnp1321)1 (2) 1(11pnnppninpnitemplatevoid insertion_sort(Type *a, int n) Type key; / cost times for (int i = 1; i =0 & ajkey ) / c4 sum
5、of ti aj+1=aj; / c5 sum of (ti-1) j-; / c6 sum og (ti-1) aj+1=key; / c7 n-1 ) 1() 1() 1() 1() 1()(7116115114321nctctctcncncncnTniiniinii) 1() 1() 1() 1()(74321minncncncncncnT)()()(743274321nOccccnccccc1112) 1() 1(ninni112) 1(ninni)()(22) 1(2) 1(2) 1(12) 1() 1() 1()(27432765432126547654321maxnOccccncccccccncccncnncnn
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 四年级数学(上)计算题专项练习及答案汇编
- 《隔离式保温板外墙保温系统应用技术规程》
- (中职)电子技术基础与技能项目三任务二呼吸灯的装调与应用工作页
- 第三单元abalanceddiet教学课件
- 2024年北京客运从业资格证学校在哪里
- 2024年合肥客运资格证情景题
- 2024年长春客运从业资格证急救考试试题教程及答案
- 2024年广西考客运资格证答题技巧
- 中秋节活动设计方案2024
- 悬挂式吊篮搭设技术措施
- 拖车损坏赔偿协议书
- 2024矿山尾矿购销合同范本
- 2024电子商务平台适老化要求
- 2024年机械制图员(中级)技能鉴定理论考试题库(含答案)
- 老旧小区加装电梯工程施工方案
- 急诊科专科护士进修汇报课件
- 心脏瓣膜病课件
- 洁净室验收要求
- 2024开荒保洁服务合同范本
- 北京理工大学-C语言程序设计乐学编程题
- 多图中华民族共同体概论课件第十一讲 中华一家与中华民族格局底定(清前中期)根据高等教育出版社教材制作
评论
0/150
提交评论