错误修正

This commit is contained in:
筱锋xiao_lfeng 2023-05-20 17:31:33 +08:00
parent 55d954ead4
commit 8d28ea320c
2 changed files with 8 additions and 2 deletions

View File

@ -1,5 +1,7 @@
/*
*
*
* xiao_lfeng
*
*/
#include <cstdio>
@ -41,7 +43,7 @@ void PutSeqList(ArrayList &L, int n) {
// 线性表的长度
int LengthList(ArrayList L) {
return L.length + 1;
return L.length;
}
// 用来找到数值为index元素的位置返回插入位置的逻辑序号逻辑序号从1开始
@ -99,6 +101,10 @@ int main() {
printf("[INFO] 表长为:%d\n", LengthList(list));
OutputSeqList(list);
// 返回第5个下标位置
int info_data = 5;
printf("[INFO] 返回下标第 %d 个下标的数据:%d\n",info_data, PositionList(list,info_data));
DestroyList(list);
system("pause");
return 0;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 419 KiB

After

Width:  |  Height:  |  Size: 410 KiB