Quiz 2
22C:80 Programming for Informatics
Tuesday, April 7th, 2009
Notes: The quiz is worth 6 points total. To get partial credit you must show your work.
1. Consider the following binary search function:
def binarySearch(C, x):
first = 0
last = len(C)-1
Quiz 2 (Solutions)
22C:80 Programming for Informatics
Monday, April 6th, 2009
Notes: The quiz is worth 6 points total. To get partial credit you must show your work.
1. Consider the following function:
def test(n):
sum = 1
while(sum <= n):
for i in range(
Quiz 1
22C:80 Programming for Informatics
Tuesday, Feb. 17, 2009
Notes: The quiz is worth 6 points total. To get partial credit you must show your work.
1. What is the result of executing program1(3, 2)? What is the result of executing program1(25, 20)?
d
Quiz 1
22C:80 Programming for Informatics
Monday, Feb. 16, 2009
Notes: The quiz is worth 6 points total. To get partial credit you must show your work.
1. What is the result of executing program1(3, 2)? What is the result of executing program1(25, 18)?
de