-
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
-
一个通用的C++委托模板类(函数对象)的实现。
一个通用的C++委托模板类(函数对象)的实现。-A common C++ Commissioned template classes (function object) is achieved.
- 2022-06-16 15:04:04下载
- 积分:1
-
MFC Windows程序设计(第二版)随书光盘
MFC Windows程序设计(第二版)随书光盘-MFC Windows Programming (2nd edition) CD with the book
- 2023-03-24 02:35:05下载
- 积分:1
-
此代码为给出一个图形,求此图形的周长面积
此代码为给出一个图形,求此图形的周长面积-This gives a code for the graphics, the graphics for this perimeter area
- 2023-02-26 08:45:04下载
- 积分:1
-
WebDownLoader 下载者附程序
WebDownLoader 下载者附程序-That those who download the WebDownLoader
- 2023-03-12 09:10:03下载
- 积分:1
-
a search function in the source code
一个查找函数的源代码 -a search function in the source code
- 2022-11-22 18:30:03下载
- 积分:1
-
using c++ to write a touch of the game, although the process is not very big, bu...
用c++写的一个touch游戏,虽然程序不是很大,但是可以对初学者有很大帮助,可选择学习!-using c++ to write a touch of the game, although the process is not very big, but can be of great help beginners option learning!
- 2022-10-17 16:20:03下载
- 积分:1
-
由John Grisham的遗嘱
the testament by john grisham
- 2023-08-08 16:45:03下载
- 积分:1
-
数据结构
详细描述了如何创建队列 以及操作
数据结构
详细描述了如何创建队列 以及操作-Data structure described in detail how to create a queue and the operation
- 2023-04-29 12:15:03下载
- 积分:1
-
简单人事管理系统
#include
#include
#include
#include
using namespace std;
const int Maxr=100;
int ID=10000;
class Employee //职工类
{
int tag;//删除标记
int no;//职工编号
char name[20];//职工姓名
char zw[20]; //职工职务
- 2022-03-24 22:13:18下载
- 积分:1