文件名称:折半查找法

  • 所属分类:
  • 并行运算
  • 资源属性:
  • 上传时间:
  • 2018-01-03
  • 文件大小:
  • 36kb
  • 下载次数:
  • 0次
  • 提 供 者:
  • JinPa******
  • 相关连接:
  • 下载说明:
  • 别用迅雷下载,失败请重下,重下不扣分!

介绍说明--下载内容均来自于网络,请自行研究使用

折半查找法是效率较高的一种查找方法。假设有已经按照从小到大的顺序排列好的五个整数a0~a4,要查找的数是X,其基本思想是: 设查找数据的范围下限为l=1,上限为h=5,求中点m=(l+h)/2,用X与中点元素am比较,若X等于am,即找到,停止查找;否则,若X大于am,替换下限l=m+1,到下半段继续查找;若X小于am,换上限h=m-1,到上半段继续查找;如此重复前面的过程直到找到或者l>h为止。如果l>h,说明没有此数,打印找不到信息,程序结束。(The method of binary search is one of the most efficient methods. Hypothesis has already ranked in accordance with the order of the growing up five integers a0 ~ a4, to find the number is X, its basic idea is: the scope of the data set to find the lower limit for l = 1, up to h = 5, strives for the midpoint m = (l + h) / 2, with X compared with neutral element am, if X is equal to the am, is found, stop looking for; Otherwise, if X is greater than am, replace the lower bound l=m+ 1, and continue to find it in the lower half; If X is less than am, change the upper limit h is equal to m minus 1, and continue to find it in the first half; Repeat the previous process until you find or l> h. If l> h, you don't have this number, print can't find the information, the program ends.)
相关搜索: Binary
search
method

(系统自动生成,下载前可以参看下载内容)

下载文件列表

文件名大小更新时间
折半查找法.cpp 1092 2016-10-29
折半查找法.exe 106190 2016-10-29

相关说明

  • 本站资源为会员上传分享交流与学习,如有侵犯您的权益,请联系我们删除.
  • 本站是交换下载平台,提供交流渠道,下载内容来自于网络,除下载问题外,其它问题请自行百度更多...
  • 请直接用浏览器下载本站内容,不要使用迅雷之类的下载软件,用WinRAR最新版进行解压.
  • 如果您发现内容无法下载,请稍后再次尝试;或者到消费记录里找到下载记录反馈给我们.
  • 下载后发现下载的内容跟说明不相乎,请到消费记录里找到下载记录反馈给我们,经确认后退回积分.
  • 如下载前有疑问,可以通过点击"提供者"的名字,查看对方的联系方式,联系对方咨询.

相关评论

暂无评论内容.

发表评论

*主  题:
*内  容:
*验 证 码:

源码中国 www.ymcn.org