Public static void erase listinteger lst

This preview shows page 2 - 4 out of 6 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
public static void erase( List<Integer> lst ){Iterator<Integer> itr = lst.iterator();while ( itr.hasNext() ){Integer x = itr.next();itr.remove();}}a. If an ArrayList is passed for lst. Explain your answer.b. If a LinkedList is passed for lst. Explain your answer.Ans:
4. What is the Big-O running time of the following code fragment?Assume lst1 has N items, and lst2 has N items.
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
return count;}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.Ans:
5. What is the Big-O running time of the following code fragment?

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture