-
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
-
The fractal code, there is a part of the fractal source code for people to learn...
分形的代码,这里有一部分的分形源代码,供人学习-The fractal code, there is a part of the fractal source code for people to learn from
- 2022-03-06 15:09:25下载
- 积分:1
-
手机屏幕显示信息.
比如电压.信号强弱.基站代码.等等.
手机屏幕显示信息.
比如电压.信号强弱.基站代码.等等.-Mobile phone screen to display information. Such as voltage. Signal strength. Basestation code. And so on.
- 2022-01-25 15:16:20下载
- 积分:1
-
多项式的加减乘除算法,特殊之处是在加减的过程中实现排序并输出,...
多项式的加减乘除算法,特殊之处是在加减的过程中实现排序并输出,-the way of mathematic
- 2022-02-21 14:00:58下载
- 积分:1
-
优龙FS2410 的串口读写驱动,可以作为串口读写的参考
优龙FS2410 的串口读写驱动,可以作为串口读写的参考-Liuzhou excellent FS2410 serial read and write drives can be used as reference for serial read and write
- 2022-07-03 22:45:45下载
- 积分:1
-
线程的例子
我自己写的
希望最大家有帮助
线程的例子
我自己写的
希望最大家有帮助-thread example, I wrote the most hope we help
- 2022-08-23 11:56:43下载
- 积分:1
-
acm竞赛参考代码,利用中缀表达式计算后缀表达式
acm竞赛参考代码,利用中缀表达式计算后缀表达式-acm contest reference code, the use of infix expression calculation expression suffix
- 2022-04-09 00:46:41下载
- 积分:1
-
实现算数的运算,包括加减乘除,2,3次开方,以及求平方差等功能。...
实现算数的运算,包括加减乘除,2,3次开方,以及求平方差等功能。-Computing to achieve counts, including the calculation, prescribing 2,3 times, and poor function of the square for.
- 2022-03-15 14:59:54下载
- 积分:1
-
列出windows进程列表中的个进程所占cpu的百分比
列出windows进程列表中的个进程所占cpu的百分比-List windows process list of the process of the percentage share of cpu
- 2022-02-01 16:59:07下载
- 积分:1
-
外接RAM点阵屏程序
外接RAM点阵屏程序
- 2022-06-03 19:12:21下载
- 积分:1