Exam 1 Answers
CS 201, Fall 2008
1. To refresh your memory, UnorderedList has methods isEmpty(), length(), add(), search(),
and remove(), in addition to the constructor. In our implementation from cla
Expected 4 year cost of
college
Loan amount
60,000
Annual interest rate
0.0376 Monthly interest rate
28,000
0.0031
of monthly
10 Number
payments
Number of years to pay
back loan
Discount rate
120
0.07
Final Exam
CS 201, Fall 2008
You have 150 minutes.
Show your work and explain all of your answers. Good work often earns partial credit. A correct
answer with no explanation often earns little or no c
Exam 3 Answers
CS 201, Fall 2010
Compare our various sorting algorithms. Which is best?
Answer: Merge sort is (n log n), but requires a lot of extra space. Quicksort is (n log n)
if the pivot is chose
Exam 2
CS 201, Spring 2009
This exam begins for you when you open (or peek inside) this packet. It ends at 11:59 PM
on Thursday 2009 May 21. Between those two times, you may work on it as much as you
Exam 2 Answers
CS 201, Fall 2010
In the AVL trees below, keys are shown but values are not. Following our standard algorithm,
insert the key 5 into the following AVL tree and restore balance.
Answer:
Exam 2
CS 201, Fall 2010
You have 60 minutes.
Show your work and explain your answers. Good work often earns partial credit. A correct
answer with no explanation often earns little or no credit.
If yo
Exam 2
CS 201, Fall 2008
This exam begins for you when you open (or peek inside) this packet. It ends at the start of class
on Monday 2008 November 3. Between those two times, you may work on it as mu
Exam 1 Answers
CS 201, Fall 2010
Im going to ask you two unrelated questions about our gcd function from class:
def gcd(a, b):
"The arguments a and b are integers with a >= b >= 0. Returns the greates
Exam 1
CS 201, Fall 2010
You have 60 minutes.
Show your work and explain your answers. Good work often earns partial credit. A correct
answer with no explanation often earns little or no credit.
If yo
Exam 1
CS 201, Spring 2009
1. Ill give two answers. The rst answer begins with Queue, as implemented in class, with
constant-time enqueueing and dequeueing. We can dene RoundRobin as a subclass of Que
Exam 1
CS 201, Spring 2009
You have 70 minutes.
Show your work and explain all of your answers. Good work often earns partial credit. A correct
answer with no explanation often earns little or no cred
Exam 1
CS 201, Fall 2008
You have 70 minutes.
Show your work and explain all of your answers. Good work often earns partial credit. A correct
answer with no explanation often earns little or no credit
Expected 4 year cost of
college
Loan amount
200,000
160,000
0.12 Monthly interest rate
Annual interest rate
0.0100
of monthly
10 Number
payments
Number of years to pay
back loan
Discount rate
120
0.07