//算法7.1 顺序查找
#include<stdio.h>
#include<stdlib.h>
#define MAXSIZE 100
#define OK 1;
typedef struct{
int key;//关键字域
}ElemType;
typedef struct{
ElemType *R;
int length;
}SSTable;
int InitList_SSTable(SSTable &L)
{
L.R=new ElemType[MAXSIZE];
if (!L.R)
{
printf("初始化错误\n");
return 0;
}
L.length=0;
return OK;
}
int Insert_SSTable(SSTable &L)
{
int j=0;
for(int i=0;i<MAXSIZE;i++)
{
L
C语言程序设计---顺序查找(两种方法)
最新推荐文章于 2025-10-21 13:24:51 发布
本文详细介绍了C语言中如何实现顺序查找的两种方法,包括简单遍历和改进后的线性搜索。通过实例代码,深入理解顺序查找的原理及效率特点,并探讨其在数据结构中的应用。

最低0.47元/天 解锁文章
3056

被折叠的 条评论
为什么被折叠?



