The University of Western Ontario
Department of Computer Science
Computer Science 1027a Midterm Exam
With Solutions
November 10, 2009
1 hour 45 minutes
Print your name:_
Student number: _
Instructions:
Fill in your name and student number above immediatel
CS1027 2009
Practice Questions from Old Final Exams
with Solutions
Part 1: Multiple Choice
1.
(3 marks) Suppose that the following method is in class D.
public static int sss(int x) cfw_
if (x % 2 = 0)
return x+1;
else
return (x - 1)*sss(x + 1);
Determin
CS1027a 2009
Practice Questions from Old Final Exams
Part 1: Multiple Choice
1.
(3 marks) Suppose that the following method is in class D.
public static int sss(int x) cfw_
if (x % 2 = 0)
return x+1;
else
return (x - 1)*sss(x + 1);
Determine the output o
Computer Science 027b Midterm Exam January Term 2006 WITH SOLUTIONS
1. (3 marks) For each of the following growth functions, write beside it its order in Big-O notation.
a) b) c)
5n2 + 1000 n 1 1235 n + n3 n + 100 log2n
_O(n^2)_ _O(n^3)_ _O(n)_
2.
(6 mark
Computer Science 027a Midterm Exam Fall 2005 with Solutions 1. (12 marks) For each of the following sentences, fill in the blank with the best one of the terms from the list below. Each term may be used one or more times, or not at all. a) A(n) _abstract
Computer Science 027b Midterm Exam - January Term 2006 1. (3 marks) For each of the following growth functions, write beside it its order in Big-O notation.
a) b) c)
5n2 + 1000 n 1 1235 n + n3 n + 100 log2n
_ _ _
2.
(6 marks) On the line beside each of th
Computer Science 027a Midterm Exam - Fall 2005 1. (12 marks) For each of the following sentences, fill in the blank with the best one of the terms from the list below. Each term may be used one or more times, or not at all. a) b) c) d) e) f) g) A(n) _ is