正在加载图片...
public bool listDelete(int i, ref string e) int j; if(i<I‖i> length) /参数错误时返回 false return false; e=datai-1; for(j=i-1i;j< length-1j++)将 datai之后的元素前移一个位置 datai=datalj+l; leng h 顺序表长度减1 return true; ∥功删除返回rue 01 i-12 n-1 Max Size-1 +1 从 batali元素开始移动起 图27删除元素时移动元素的过程public bool ListDelete(int i,ref string e) { int j; if (i<1 || i>length) //参数错误时返回false return false; e=data[i-1]; for (j=i-1; j<length-1;j++) //将data[i]之后的元素前移一个位置 data[j]=data[j+1]; length--; //顺序表长度减1 return true; //成功删除返回true }
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有