Question 1: What is the Big-O running time of the subsequent code fragment?
Assume lst1 has N items, and lst2 is initially empty.
public static void add( List lst1, List lst2)
{
for ( Integer x : lst1 )
lst2.add(0, x); // add to front
}
a. If an ArrayList is passed for lst1 and lst2. Describe your answer.
b. If a LinkedList is passed for lst1 and lst2. Describe your answer.