C S 314 Midterm: Spring_2018_E1

22 views16 pages
31 Jan 2019
School
Course
Professor

Document Summary

Points off 1 2 3 4 5 6 total off net score. Shelby: there are 6 questions on this test. Scores will be scaled to 170 points: you have 2 hours to complete the test, place your final answers on this test. Place your answer on the line next to or under the question. For example, selection sort has an average case big o of o(n2), but per the formal definition of big o it is correct to say selection sort also has a big o of o(n3) or o(n4). Give the most restrictive, correct big o function. (closest without going under. : assume log2(1,000) = 10 and log2(1,000,000) = 20. Arraylist listc = new arraylist<>(); listc. add(0, "k"); listc. add("v"); listc. add(0, "j"); listc. add(1, listc. get(2)); listc. set(2, listc. get(0) + listc. size()); It takes the method 20 seconds to complete when n = 50,000. It takes 1 second for the method to complete when n = 10,000.

Get access

Grade+
$40 USD/m
Billed monthly
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
10 Verified Answers

Related Documents