C S 314 Midterm: Spring_2013_m2_GradingCrit_And_Solutions

29 views7 pages
31 Jan 2019
School
Course
Professor

Document Summary

Cs314 spring 2013 midterm 2 solution and grading criteria. Aiobe - array index out of bounds exception may occur. Not certain code works, but, can"t prove otherwise. Gacky or gack - code very hard to understand even though it works. (solution is not elegant. ) Did not answer the question asked or showed fundamental misunderstanding. Rtq - read the question. violated restrictions or made bad assumption: answer as shown or -1 unless question allows partial credit. 110,000 << 5,000,000 so sort then search: 45 seconds, 1. 5 seconds, o(n2, o(n) This question was all about dealing with various abstractions and data structures and types. Errors on bounds not checking that the last n decades were unranked. Using 0 or the constant listed instead of unranked. Assuming keys in map were namerecords (they are strings) Alternate solution that is a little less efficient: int count = 0;\ final int start_decade = num_decades - n; for(string name : data. keyset()) { return count;