-
Description:
对整型有序关键码序列进行折半查找,待排序序列以数组存储。如果找到待查记录,返回找到的位置下标,并删除该关键码记录;如果没找到待查记...
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
- 2023-05-15 19:40:03下载
- 积分:1
-
二叉树的前序,中序,后序,遍历等一系列操作
二叉树的前序,中序,后序,遍历等一系列操作-Binary tree preorder, inorder, postorder, traversing a series of operations
- 2022-08-21 02:45:19下载
- 积分:1
-
hex转BIN,BIN转Hex
STM32格式转换工具,VS2012编写,支持HEX格式文件转为BIN文件,以及BIN文件转HEX文件。
- 2022-03-25 16:16:01下载
- 积分:1
-
Windows核心编程(第五版)随书源代码,需要的可参考。
Windows核心编程(第五版)随书源代码,需要的可参考。-the code of Windows Kernel Program.
- 2022-04-08 22:24:26下载
- 积分:1
-
vc下利用ODBC API对数据库的操作,包括增、删、改。可以移植、通用...
vc下利用ODBC API对数据库的操作,包括增、删、改。可以移植、通用-vc using ODBC API to the database operations, which include additional cut, change. Transplant GM
- 2022-11-16 03:00:03下载
- 积分:1
-
jathena are the Japanese, open source web server ragnarok. Three are in a writte...
jathena是日本的开源web服务器ragnarok。三个是书面的
- 2022-01-25 16:57:42下载
- 积分:1
-
多线程访问数据库 方便大家学习参考,今天奉献出来
多线程访问数据库 方便大家学习参考,今天奉献出来-Multi-threaded access to the database for reference to facilitate them to learn from today, out of devotion
- 2022-01-25 22:59:57下载
- 积分:1
-
电话簿管理系统,实现对电话簿的插入、删除、修改、排序等...
电话簿管理系统,实现对电话簿的插入、删除、修改、排序等-Phone book management system to achieve the insertion of the phone book, delete, modify, sort, etc.
- 2022-03-07 14:22:42下载
- 积分:1
-
this best way to see how is this or that on this
this best way to see how is this or that on this-this is best way to see how is this or that on this
- 2022-06-21 22:39:29下载
- 积分:1
-
Samsung ARM9 chip s3c2410 Jack 4.2BSP the source code, according to the developm...
三星ARM9芯片s3c2410的wince 4.2BSP源代码,可以根据自己的开发板做少量修改即可使用-Samsung ARM9 chip s3c2410 Jack 4.2BSP the source code, according to the development board to do some modifications in order to use
- 2022-05-09 02:09:10下载
- 积分:1