1 Star 0 Fork 0

CoderQi/cg初学

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
Seqlist23_12.h 1.17 KB
一键复制 编辑 原始数据 按行查看 历史
CoderQi 提交于 2023-01-02 19:53 +08:00 . 23_12
#pragma once
#define N 100
#include<stdio.h>
#include<stdlib.h>
#include<assert.h>
//静态
//typedef int sldatatype;
//
//typedef struct seqlist
//{
// sldatatype a[N];
// int size;//存储了多少个数据
//}sl;
////接口
//void seqlistinit(sl* ps, sldatatype x);
//void seqlistpushback(sl*ps, sldatatype x);//尾插
//void seqlistpopback(sl* ps);//尾删
//void seqlistpushfront(sl* ps, sldatatype x);//头插
//void seqlistpopfront(sl* ps);//头删
typedef int sldatatype;
typedef struct seqlist
{
sldatatype* a;
int size;//存储了多少个数据
int capacity;//数组实际能存多大
}SL;
//接口
void seqlistinit(SL* ps);
//尾插函数的声明
void seqlistpushback(SL* ps, sldatatype x);
//打印函数的声明
void slprint(SL* ps);
void seqlistdestroy(SL* ps);//释放内存
void seqlistpopback(SL* ps);//尾删
void seqlistpushfront(SL* ps, sldatatype x);//头插
void seqlistpopfront(SL* ps);//头删
void seqlistcheckcapacity(SL* ps,sldatatype x);//检查扩容
//找到了返回x位置的下标,没找到返回-1
int seqlistfind(SL* ps, sldatatype x);
//指定pos下标位置插入
void seqlistinsert(SL* ps, int pos, sldatatype x);
//删除pos位置的数据
void seqlisterase(SL* ps, int pos);
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/programmercg/cg-beginner.git
git@gitee.com:programmercg/cg-beginner.git
programmercg
cg-beginner
cg初学
master

搜索帮助