当前位置:网站首页>Deletion of the sequence table
Deletion of the sequence table
2022-07-31 10:17:00 【[email protected]】
Take the data stored in the sequence table as an example of an integer type ~
- 按位序删除
bool ListDelete(SqList &L,int i,int &e){
if(i<1||i>L.length) // i为位序
return false;
e=L.data[i-1];
for(int j=i;j<=L.length-1;j++){
//前移
L.data[j-1]=L.data[j];
}
L.length--;
return true;
}
- 按下标删除
bool ListDelete(SqList &L,int i,int &e){
if(i<0||i>L.length-1) // i为下标
return false;
e=L.data[i];
for(int j=i+1;j<=L.length-1;j++){
//前移
L.data[j-1]=L.data[j];
}
L.length--;
return true;
}
版权声明
本文为[[email protected]]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/212/202207311008456013.html
边栏推荐
猜你喜欢
随机推荐
LeetCode二叉树系列——101.对称二叉树
Redis的简单使用
恋爱期间的赠与能否撤销
Principle of Redis Sentinel
SQLite3交叉编译
ASP.NET 身份认证框架 Identity(一)
通过栗子来学习MySQL高级知识点(学习,复习,面试都可)
踩水坑2 数据超出long long
开放麒麟 openKylin 自动化开发者平台正式发布
NowCoderTOP17-22 二分查找/排序——持续更新ing
湖仓一体电商项目(二):项目使用技术及版本和基础环境准备
Build finished with errors/Executable Not Found
loadrunner-controller-目标场景Schedule配置
SQLServer2019安装(Windows)
Rich text editor Tinymce
SQLSERVER将子查询数据合并拼接成一个字段
半个月时间把MySQL重新巩固了一遍,梳理了一篇几万字 “超硬核” 文章!
Business-(Course-Chapter-Subsection) + Course Publishing Some Business Ideas
FCN中制作自己的数据集并进行训练
nodeJs--querystring模块








