- 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 4、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 5、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 6、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 7、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
第八章程序查找(The eighth chapter search program)
第八章程序查找(The eighth chapter search program)
8.4 application questions
1., the sequential search time is O (n), the dichotomy search time is O (log2n), and the hash method is O (1). Why is there efficient search method, and inefficient methods are not abandoned?
[answer] different search methods vary in scope. Efficient search methods are not always more efficient than other search methods in all cases, and they are not available in all cases.
2. pairs of N containing different elements of the collection, while looking for the maximum and minimum yuan, at least how many comparisons?
[answer] n-1 times
[analysis] the variables Max and min are used to store the maximum and minimum (location), the first to compare the two elements, large into max, small into the min. From the beginning of second, each taking a first element and Max, if more than max to replace it with Max, and the end of the comparison; if less than max is compared with min, in the best case, it doesnt compare with min, so in this case, at least. N-1 comparison will find the maximum and minimum yuan yuan.
3., if the ordered sequential table with n elements and unordered order table are searched sequentially, the average search length of the two in equal probability is discussed respectively in the following two cases:
(1) find unsuccessful, that is, no keyword in the table equal to the record of the given value K;
(2) finding success, that is, the key in the table is equal to the record of the given value K.
[answer]
(1) n+1 comparisons are needed when unsuccessful
(2) the average time of success was (n+1) /2 times
[parse] when ordered and unordered tables are searched sequentially, n+1 comparisons are needed to determine the search failure. Therefore, the average lookup length is n+1. When searching for success, the average lookup length is (n+1) /2, and the ordered table and unordered table are the same. Because sequential lookups are independent of the initial sequence state of the table.
5. why not a
您可能关注的文档
- 磁性材料在通讯产业中的应用(Application of magnetic materials in the communication industry.).doc
- 碳化钨烧结成型(Tungsten carbide sintering).doc
- 磁盘清理,不知道有没有用 大家看看吧(Disk cleanup, do not know there is no use we look at it).doc
- 磁铁原理知识等等(Magnet principle knowledge and so on).doc
- 磁阻传感器与地磁场实验(Magnetoresistive sensor and magnetic field experiment).doc
- 磨具英语(Abrasives English).doc
- 磐石经济开发区(Economy development area).doc
- 礼仪论文摘要(Abstract etiquette).doc
- 社会医学重点(The focus of social medicine).doc
- 磁极变换(Pole shift).doc
- 第八节 如何打造超效能团队(How to create a super team effectiveness eighth day).doc
- 第六章 地下建筑工程(The sixth chapter of underground construction).doc
- 第六章 思维与想象(The sixth chapter of thinking and imagination).doc
- 第五章发展与合作(二)(The fifth chapter development and cooperation (two)).doc
- 第六章 冲突规范(The sixth chapter of conflict rules).doc
- 第六章 管道(The sixth chapter pipeline).doc
- 第六章 经济法的实施(The sixth chapter introduces the implementation of economic law).doc
- 第六章 采用中、大规模集成电路的逻辑设计(The sixth chapter used in large scale integrated circuit, logic design).doc
- 第六讲 时间管理降龙18掌(下)(Sixth time management 18 dragon subduing palms (below)).doc
- 第十一章 农业产业化经营(The eleventh chapter of agricultural industrialization).doc
最近下载
- 2024-2025学年(上)厦门市期末质量检测期末复习提纲-初二地理.docx VIP
- 邮政普遍服务行政处罚裁量基准.xls VIP
- 电网检修工程预算定额 第三册 调试工程.docx VIP
- 2023-2024学年(上)厦门市期末质量检测-初二生物.pdf VIP
- TB 10304-2020铁路隧道工程施工安全技术规程(高清).pdf VIP
- 东芝CV330A资料.doc VIP
- 海员证书查询.doc VIP
- 2020新译林版高二英语选择性必修三unit1课文及翻译(英汉对照).doc VIP
- 初中英语2025届中考新课标词汇表(共2000个).pdf VIP
- 川教版初中七年级下册《信息技术》全套教学课件.pptx
原创力文档


文档评论(0)