hw3.pdf - CS 5343 u2013 Data Structures and Algorithms...

This preview shows page 1 - 3 out of 8 pages.

CS 5343 Data Structures and Algorithms SXS180355 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? Solution:
2. What is the Big-O running time of the following code fragment? Assume lst1 has N items, and lst2 is initially empty.
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. Solution:

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture