Quiz 2 Graded
Student
Tanvi Mathur
Total Points
15.5 / 20 pts
Question 1
Q1 3 / 3 pts
1.1 a 1 / 1 pt
− 0 pts Correct
− 1 pt Incorrect
− 1 pt Not Attempted
1.2 b 1 / 1 pt
− 0 pts Correct
− 1 pt Incorrect
− 1 pt Not attempted
1.3 c 1 / 1 pt
− 0 pts Correct
− 1 pt Incorrect (it has polynomial of n terms which are greater than nlogn)
− 1 pt Not Attempted
Question 2
Q2 2.5 / 5 pts
+ 2.5 pts The correct output of a_filtered list is values of a which satisfy the filter condition
for example, e = 2, then a_filtered = [2, 3, 5, 21, 34, 55]
+ 2.5 pts The correct output of the a_mapped list is values of a which are updated by f function
for example, e = 2, then a_mapped = [0, 0, 1, 2, 5, 8, 13]
+ 0 pts Incorrect output of a_filtered list
+ 0 pts Incorrect output of a_mapped list
Question 3
Q3 5 / 5 pts
+ 5 pts Correct Solution:
(Left diagonal included)
sum = 0
for i in range( len(A) ) :
for j in range( i, len(A[0]) ) :
sum += A[i][j]
OR
(Left diagonal not included)
sum = 0
for i in range( len(A) ) :
for j in range( i+1, len(A[0]) ) :
sum += A[i][j]
+ 2 pts Correct termination condition used in the loops.
for i in range(len(A)):
for j in range(i+1, len(A[0]):
OR
for i in range(len(A)):
for j in range(i, len(A[0]):
+ 2 pts Correctly performed sum.
+ 1 pt Used two for loops for computing the sum
+ 0 pts Incorrect Solution or Not Attempted
Question 4
Q4 5 / 7 pts
+ 7 pts Correct
+ 0 pts Incorrect
+ 2 pts correct output of the program.
if e is even then 21 (maximum element) else 1 (minimum element)
+ 2 pts correct recurence relation. T(n) = 2 * T(n/2) + c
+ 3 pts correctly solved recurrence relation and correct final Time complexity.
+ 1 pt correct time complexity, but no derivation
− 1 pt minor error in recurrence relation