C S 314 Midterm: Spring_2016_E2

19 views17 pages
31 Jan 2019
School
Course
Professor

Document Summary

Points off 1 2 3 4 5 6 total off raw score. Instructions: there are 6 questions on this test. Scores will be scaled to 200 points: you have 2 hours to complete the test, place you 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). I want the most restrictive, correct big o function. (closest without going under. ) ____________________ return 3; public int methoda(int x) { if (x <= 1) { } else { return 2 + methoda(x - 3); return 1 + methoda(x / 2); Assume list1. size() = list2. size() = n for (int j = i; j < list2. size(); j++) { if (list1. get(i). equals(list2. get(j))) { result += list1. get(i); return 1; if (x <= 0) {

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers

Related Documents