标签:bing int auto public imp gen system bool ati
import java.util.ArrayList;
import java.util.List;
public class H合并线性表 {
static List<Integer> newarray=new ArrayList();
public static void arrayhebing(int array1[],int array2[])
{
for(int i=0;i<array1.length;i++)
{
newarray.add(array1[i]);
}
for(int i=0;i<array2.length;i++)
{
boolean isadd=true;
for(int j=0;j<newarray.size();j++)
{
if(array2[i]==newarray.get(j))
{
newarray.add(j+1,array2[i]);
isadd=false;
break;
}
}
if(isadd)
{
newarray.add(array2[i]);
}
}
}
public static void main(String[] args) {
// TODO Auto-generated method stub
int array1[]= {2,5,1,88,63,23,6};
int array2[]= {56,88,23,4,9,14,89};
arrayhebing(array1,array2);
for(int i=0;i<newarray.size();i++)
{
System.out.print(newarray.get(i)+" ");
}
}
}
标签:bing int auto public imp gen system bool ati
原文地址:https://www.cnblogs.com/lwyy1223-/p/12818301.html