Assignment #3 Chapter 3 10 points 1.Linked lists and arrays: a.What are some advantages of linked lists versus arrays? b.What are some advantages of arrays versus linked lists? Answer: 15 points 2.What is the Big-O running time of the following code fragment? Assume lst1 has N items, and lst2 is initially empty.
lst2.add(0, x); // add to front } a.If an ArrayList is passed for lst1 and lst2. Explain your answer. b.If a LinkedList is passed for lst1 and lst2. Explain your answer. Answer: