登录
首页 » Windows开发 » Description: 对整型有序关键码序列进行折半查找,待排序序列以数组存储。如果找到待查记录,返回找到的位置下标,并删除该关键码记录;如果没找到待查记...

Description: 对整型有序关键码序列进行折半查找,待排序序列以数组存储。如果找到待查记录,返回找到的位置下标,并删除该关键码记录;如果没找到待查记...

于 2023-05-15 发布 文件大小:4.79 kB
0 98
下载积分: 2 下载次数: 1

代码说明:

Description: 对整型有序关键码序列进行折半查找,待排序序列以数组存储。如果找到待查记录,返回找到的位置下标,并删除该关键码记录;如果没找到待查记录,返回0,并将待查记录插入到适当位置,即该查找属于动态查找。输出查找过程中每一轮的low,mid,high 值,以及与给定值相比较的关键码值,并输出最后找到的位置,及变化后的数组。 注意:该数组为整型,数组中关键码存储位置为r[1]~r[n],r[0]留作它用,且关键码个数大于4. Input Format: 第一行输入数组中记录个数n 第二行输入n个有序的整型关键码,以空格隔开 接下来输入三个待查关键码,每个关键码占一行 Output format: 对于每个关键码,分别输出: 找到给定值之前的每一轮的low,mid,high及相比较的待查找序列中的关键码,以空格隔开 接下来一行输出查找到的位置 接下来一行输出变化后的待查找序列 -Description: The key codes for integers ordered sequence of binary search until the sorting sequence to an array of storage. If you find a complete set of records, returns to find the location of the next standard, and delete the key code is recorded if not find a complete set of records, returns 0, and a complete set of records inserted into the appropriate location, that is, the search was part of search. Find out the process for each one of the low, mid, high value, as well as compared to the value given the key code value and output of the last to find the locat

下载说明:请别用迅雷下载,失败请重下,重下不扣分!

发表评论

0 个回复

  • 100个经典程序,主要是由C语言编写的经典程序,由易到难,非常适合新手学习...
    100个经典程序,主要是由C语言编写的经典程序,由易到难,非常适合新手学习-100 classic program, mainly by the C language written in the classic procedure, Youyidaonan very suitable for novice to learn
    2022-01-26 03:28:25下载
    积分:1
  • Reversi game, using C to prepare to use VISUAL c++ Debugging
    黑白棋小游戏,用C++编写 用VISUAL c++调试-Reversi game, using C to prepare to use VISUAL c++ Debugging
    2022-04-12 19:30:29下载
    积分:1
  • asp多功能投票系统
    1.所有的投票根据主题进行分类,系统可以设置任意多个投票主题 2.可以设置任意多个投票的问题以及答案 3.可以任意设置单选或者是多选形式的投票 4.可以设定是否限制同一IP重复投票,并且能够设置同一IP重复投票时间的限制 5.可以设定是否收集参与投票用户的信息 6.可以设定是否限制用户查看投票结果 7.可以设定投票主题的到期时间 8.可以清空整个投票主题的投票记录、票数 9.可以设置投票是文字形式还是图片形式 10.可以设置投票项每行的排列数量 11.在后台添加投票时,可是先行设定某个投票项的初始票数,设定票数时也会自动更新投票人数(适用于特殊用途)
    2023-06-01 09:15:03下载
    积分:1
  • 论坛上贴的碰撞小球,修改了一下,加了一些代码。有兴趣可以看一下。...
    论坛上贴的碰撞小球,修改了一下,加了一些代码。有兴趣可以看一下。-Forum posted the collision the ball, modify it, add some code. Interest can have a look.
    2023-05-03 00:25:02下载
    积分:1
  • 并行和串行射机
    这两个程序通过并行(或串行)端口将数据发送到一个7段显示器。可设置的参数包括:波特率,奇偶校验,延迟等
    2022-03-18 16:02:09下载
    积分:1
  • 完成万年历的各种功能,可以显示年、月、日、时、分、秒 、星期,还是显示实时温度!具备基本的各项功能!...
    完成万年历的各种功能,可以显示年、月、日、时、分、秒 、星期,还是显示实时温度!具备基本的各项功能!-Completion of the various calendar functions, you can display year, month, day, hour, minute, seconds, weeks, or show real-time temperature! Equipped with the basic functions!
    2022-01-26 00:22:08下载
    积分:1
  • 透明窗口能够拉动来调节透明度
    透明窗口能够拉动来调节透明度-It can adjust the degree of transparency by draw the bar.
    2022-11-06 23:15:03下载
    积分:1
  • Caculater source code for delphi
    基本计算器源代码德尔福。基本计算器源代码德尔福。基本计算器源代码德尔福。基本计算器源代码德尔福。基本计算器源代码德尔福。基本计算器源代码德尔福。基本计算器源代码德尔福。基本计算器源代码德尔福。基本计算器源代码德尔福;计算器源代码;
    2022-12-22 18:05:03下载
    积分:1
  • 《面向对象程序设计》练习10_7的源代码
    《面向对象程序设计》练习10_7的源代码- Object-oriented programming, the source code of practice 10_7
    2022-10-01 11:55:03下载
    积分:1
  • 讨论Attribute的高级应用,代码演示了一个实际的例子:假设有一个订单处理系统,当一份订单提交的时候,系统检查库存,如果库存存量满足订单的数量,系统记录订单...
    讨论Attribute的高级应用,代码演示了一个实际的例子:假设有一个订单处理系统,当一份订单提交的时候,系统检查库存,如果库存存量满足订单的数量,系统记录订单处理记录,然后更新库存,如果库存存量低于订单的数量,系统做相应的记录,同时向库存管理员发送邮件。 大致介绍了.NET Framework的对象调用拦截的实现机制,目的是让大家对这种机制有一个认识,通过代码的实现,可以看到消息如何被处理的过程。-Attribute to discuss high-level application code to demonstrate a practical example: Suppose there is a order processing system, when an order when submitted, the system checks inventory, if the inventory stock to meet the number of orders, the system record deal with record orders, and then update Stock, if the inventory stock is lower than the number of orders, the system to do the appropriate records, at the same time send a message to the Inventory Manager. Generally introduced. NET Framework object call interception mechanism to realize the aim is to enable everyone to have an understanding of such a mechanism, through the realization of the code, you can see how the news process.
    2022-08-26 14:00:02下载
    积分:1
  • 696518资源总数
  • 105540会员总数
  • 37今日下载