diff --git a/main.cpp b/main.cpp index c461374..ecf51e3 100644 --- a/main.cpp +++ b/main.cpp @@ -1,5 +1,7 @@ /* - * + * 代码说明 + * 代码由 筱锋xiao_lfeng 编写 + * 其开发者由 */ #include @@ -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; diff --git a/鍙傝冨浘.png b/鍙傝冨浘.png index 542c261..ef65662 100644 Binary files a/鍙傝冨浘.png and b/鍙傝冨浘.png differ