严蔚敏数据结构:线性表的基本操作--纯C语言实现可直接运行

复习的时候随手敲的,可以直接运行,main函数里是我检查结果的,可以自行删去。

如果有地方可以改进可以评论我谢谢!仅供参考

# include <stdio.h>
#include<malloc.h>
#include<stdlib.h>
# define SIZE 10
# define OK 1
# define TRUE 1
# define ERROR 0
# define FALSE 0
#define  OVERFLOW  -1 
#define LIST_INIT_SIZE 100//线性表存储空间的初始分配量
#define LISTINCREMENT 10//线性表初始存储空间的分配增量

typedef int Status; 
typedef int ElemType;
typedef struct{
	ElemType * elem;//储存空间基地址
	int length;//当前表长
	int listsize;//当前分配的存储容量(单位为sizeof(ElemType))
}SqList;

Status InitList_Sq(SqList * L);
Status DestroyList_Sq(SqList * L);
Status ClearList_Sq(SqList * L);
Status ListEmpty(SqList L);
int ListLength(SqList L);
Status GetElem(SqList L, int i, ElemType * e);
Status LocateElem(SqList L, ElemType e, Status(*Compare)());
Status PriorElem(SqList L, ElemType cur_e, ElemType * pre_e);
Status NextElem(SqList L, ElemType cur_e, ElemType * next_e);
Status ListInsert_Sq(SqList * L, int 
  • 1
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值