数据结构

位置:IT落伍者 >> 数据结构 >> 浏览文章

数据结构之顺序表上基本运算的实现[7]


发布日期:2019年09月27日
 
数据结构之顺序表上基本运算的实现[7]

return(); /*表不存在不能插入*/

}

if (SeqListPoint> length >= MAXSIZE)

{

printf(表溢出);

return(); /*表空间已满不能插入*/

}

if (i< || i> SeqListPoint> length +) /*检查插入位置的合法性*/

{

printf(插入位置不合法);

return();

}

for(j= SeqListPoint > length ; j>=i; j)

SeqListPoint >data[j+]= SeqListPoint >data[j]; /* 移动元素 */

SeqListPoint >data[i]=x;/*新元素插入*/

SeqListPoint > length ++; /*表长加 */

return ();/*插入成功返回*/

}

[] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []

               

上一篇:数据结构之顺序表上基本运算的实现[8]

下一篇:数据结构之顺序表上基本运算的实现[6]