提交 b23128f3 创建 作者: 宋海霞's avatar 宋海霞

modify

上级 e55cdde4
...@@ -8,7 +8,7 @@ int main(int argc, char* argv[]) ...@@ -8,7 +8,7 @@ int main(int argc, char* argv[])
ElemType Elem; ElemType Elem;
// //
// 初始化线性表 // Initialize the linear table
// //
List.nLength = 8; List.nLength = 8;
for(i=0; i<List.nLength; i++) for(i=0; i<List.nLength; i++)
...@@ -18,7 +18,7 @@ int main(int argc, char* argv[]) ...@@ -18,7 +18,7 @@ int main(int argc, char* argv[])
// 在第 i 个元素之前插入元素 // 在第 i 个元素之前插入元素
// //
InsertBefore(&List, 18, 4); InsertBefore(&List, 18, 4);
InsertBefore(&List, 20, 11); // 插入位置非法。插入失败。 InsertBefore(&List, 20, 11); // 插入位置非法.插入失败.
for(i=0; i<List.nLength; i++) for(i=0; i<List.nLength; i++)
{ {
...@@ -31,24 +31,24 @@ int main(int argc, char* argv[]) ...@@ -31,24 +31,24 @@ int main(int argc, char* argv[])
} }
/* /*
功能: function:
在第 i 个元素之前插入一个元素 在第 i 个元素之前插入一个元素.
参数: parameter:
pList -- 线性表 pList -- Linear table
Elem -- 插入的元素 Elem -- 插入的元素
i -- 指定位置。从 1 开始计数。 i -- 指定位置.从 1 开始计数.
返回值: returned value:
如果插入成功返回 1 如果插入成功返回 1
如果插入失败返回 0 如果插入失败返回 0
*/ */
int InsertBefore(SqList* pList, ElemType Elem, int i) int InsertBefore(SqList* pList, ElemType Elem, int i)
{ {
int nIndex; // 用于移动元素的游标 int nIndex; // The cursor used to move elements
// //
// TODO: 在此添加代码 // TODO: Add the code here
// //
return 0; return 0;
......
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论