assignment3 - 1 Linked lists and arrays a What are some...

This preview shows page 1 - 2 out of 4 pages.

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?
2. What is the Big-O running time of the following code fragment?Assume lst1 has N items, and lst2 is initially empty.public static void add( List<Integer> lst1, List<Integer> lst2){for ( Integer x : lst1 )lst2.add(0, x); // add to front}a. If an ArrayList is passed for lst1 and lst2. Explain your answer.
)

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture