#3 - What are some advantages of a linked list versus an...

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

We have textbook solutions for you!
The document you are viewing contains questions related to this textbook.
Systems Architecture
The document you are viewing contains questions related to this textbook.
Chapter 3 / Exercise 13
Systems Architecture
Burd
Expert Verified
What are some advantages of a linked list versus an array?
1.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.
b. If a LinkedList is passed for lst1 and lst2. Explain your answer.
2. (might be a match)What is the Big-O running time of the following code fragment?
We have textbook solutions for you!
The document you are viewing contains questions related to this textbook.
Systems Architecture
The document you are viewing contains questions related to this textbook.
Chapter 3 / Exercise 13
Systems Architecture
Burd
Expert Verified

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture