t**c 发帖数: 480 | 1 //lst1 has N items, and lst2 has M items
public static void Print( List lst1, List lst2)
{
Iterator itr1 = lst1.iterator();
Iterator itr2 = lst2.iterator();
while (itr1.hasNext() || itr2.hasNext())
{
int x=0, y=0;
if (itr1.hasNext())
{
x = itr1.next();
System.out.println(x);
}
if (itr2.hasNext())
{
y = itr2.next();
System.out.println(y);
}
}
}
这道题,不管lst1和lst2是Array还是linked, big(o)都是一样吧,就是M,N里的最
大值吧
谢谢! | z*c 发帖数: 63 | | t**c 发帖数: 480 | 3 对于 Arraylist还是linkedlist,
这个不影响吧 |
|