顺序表之删除算法
2020-12-13 06:00
标签:Stub eth static 顺序 ted ring new gen string public class delTest { 顺序表之删除算法 标签:Stub eth static 顺序 ted ring new gen string 原文地址:https://www.cnblogs.com/had1314/p/11161239.html
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
int alist[]=new int[10];
alist[0]=1;
alist[1]=2;
alist[2]=3;
alist[3]=4;
alist[4]=5;
alist[5]=6;
alist[6]=7;
del(alist,2);
forprint(alist);
}
public static void del(int[] alis,int value) {
for(int i=0;i
System.out.println("数组为空!");
}
if(i==value) {
for (int j = value; j alis[j-1]=alis[j];
}
}
}
}
public static void forprint(int[] alis) {
for(int i = 0;i
}
}
}
上一篇:java面试----题库2