containsSum, shown below, returns true if there exists two unique numbers in the list that sum to K. Assume N is the size of the list. a. What is the running time of containsSum when the list is an...


containsSum, shown below, returns true if there exists two unique numbers in the list that sum to K. Assume N is the size of the list.


a. What is the running time of containsSum when the list is an ArrayList?


 b. What is the running time of containsSum when the list is a LinkedList?


 c. Suppose it takes 2 seconds to run containsSum on a 1,000-item ArrayList. How long will it take to run containsSum on a 3,000-item ArrayList? You may assume containsSum returns false in both cases.

Nov 18, 2021
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here