CS 601 Exam 1 Solution Spring 2005 Solve any 5 of these 6 problems, or try all 6 for extra credit if you have time. 1. Solve each of these recurrences to obtain T(n) as a function of n. Briefly justify each answer. a. T(n) = 4 T(n/2) + 1 Master recurrence
CS 601 Pre-test
Spring 2011
Solution
1. The divide-and-conquer algorithm shown below takes an arbitrarily-ordered array A[1n], and
returns its smallest value. Write a recurrence equation for the running time T(n) of this
algorithm, and also solve the recu
CS 601 Exam 1
Spring 2011
Solution
1. Write an efficient multi-threaded recursive pseudo-code function that finds and returns
the maximum value in an array of size n. Analyze the work, span, and parallelism.
findMax (A, low=1, high=n) cfw_
if (low=high) r
CS 601 Exam 2
Spring 2011
Name _
1. Consider the linear program shown below. First rewrite it in standard form, and then also
write its dual linear program. (Do not solve these linear programs.) Finally, state the weak
duality theorem and the strong duali
CS 601 Exam 2
Spring 2011
Solution
1. Consider the linear program shown below. First rewrite it in standard form, and then also
write its dual linear program. (Do not solve these linear programs.) Finally, state the weak
duality theorem and the strong dua
CS 601 Exam 3
Spring 2011
Name _
1. Show how to use the Chinese remainder theorem to determine all solutions for this set of
congruence equations: x = 2 (mod 3), x = 3 (mod 4), x = 4 (mod 5).
2. Consider the RSA cryptosystem with primes p=3 and q=11. Firs
CS 601 Exam 3
Spring 2011
Solution
1. Show how to use the Chinese remainder theorem to determine all solutions for this set of
congruence equations: x = 2 (mod 3), x = 3 (mod 4), x = 4 (mod 5).
N = 3 * 4 * 5 = 60.
m1 = 60/3 = 20, m2 = 60/4 = 15, m3 = 60/5
CS 601 Exam 4
Spring 2011
Name _
1. Trace any three of these four algorithms to show how to find the convex hull for these points:
(0,2), (1,3), (2,8), (3,7), (4,4), (5,1), (6,0), (7,5), (8,6). Show enough detail to demonstrate how
each algorithm works, b
CS 601 Exam 4
Spring 2011
Solution
1. Trace any three of these four algorithms to show how to find the convex hull for these points:
(0,2), (1,3), (2,8), (3,7), (4,4), (5,1), (6,0), (7,5), (8,6). Show enough detail to demonstrate how
each algorithm works,
CS 601 Pre-test
Spring 2011
Solution
1. The divide-and-conquer algorithm shown below takes an arbitrarily-ordered array A[1n], and
returns its smallest value. Write a recurrence equation for the running time T(n) of this
algorithm, and also solve the recu
CS 601 Exam 4
Spring 2011
Solution
1. Trace any three of these four algorithms to show how to find the convex hull for these points:
(0,2), (1,3), (2,8), (3,7), (4,4), (5,1), (6,0), (7,5), (8,6). Show enough detail to demonstrate how
each algorithm works,
CS 601 Exam 3
Spring 2011
Solution
1. Show how to use the Chinese remainder theorem to determine all solutions for this set of
congruence equations: x = 2 (mod 3), x = 3 (mod 4), x = 4 (mod 5).
N = 3 * 4 * 5 = 60.
m1 = 60/3 = 20, m2 = 60/4 = 15, m3 = 60/5
CS 601 Exam 1
Spring 2011
Solution
1. Write an efficient multi-threaded recursive pseudo-code function that finds and returns
the maximum value in an array of size n. Analyze the work, span, and parallelism.
findMax (A, low=1, high=n) cfw_
if (low=high) r
CS 601 Exam 2 Solution Spring 2005 Solve any 5 of these 6 problems, or try all 6 for extra credit if you have time. 1. A ski rental agency has n pairs of skis, and there are n skiers who wish to rent skis. You are given (in inches) the heights of the skie
CS 601 Exam 2
Spring 2011
Solution
1. Consider the linear program shown below. First rewrite it in standard form, and then also
write its dual linear program. (Do not solve these linear programs.) Finally, state the weak
duality theorem and the strong dua
CS 601 Exam 3
Spring 2011
Solution
1. Show how to use the Chinese remainder theorem to determine all solutions for this set of
congruence equations: x = 2 (mod 3), x = 3 (mod 4), x = 4 (mod 5).
N = 3 * 4 * 5 = 60.
m1 = 60/3 = 20, m2 = 60/4 = 15, m3 = 60/5
CS 601 Exam 4
Spring 2011
Solution
1. Trace any three of these four algorithms to show how to find the convex hull for these points:
(0,2), (1,3), (2,8), (3,7), (4,4), (5,1), (6,0), (7,5), (8,6). Show enough detail to demonstrate how
each algorithm works,
CS 601 Final Exam Spring 2005
Name _
Each of these 8 problems is worth 20 points. You may attempt all 8 if you wish. 1. Solve each of these recurrences to obtain T(n) as a function of n. Provide a brief convincing justification for each answer. a. T(n) =
CS 601 Pre-test
Spring 2011
Solution
1. The divide-and-conquer algorithm shown below takes an arbitrarily-ordered array A[1n], and
returns its smallest value. Write a recurrence equation for the running time T(n) of this
algorithm, and also solve the recu
CS 601 Exam 1
Spring 2011
Solution
1. Write an efficient multi-threaded recursive pseudo-code function that finds and returns
the maximum value in an array of size n. Analyze the work, span, and parallelism.
findMax (A, low=1, high=n) cfw_
if (low=high) r
CS 601 Exam 2
Spring 2011
Solution
1. Consider the linear program shown below. First rewrite it in standard form, and then also
write its dual linear program. (Do not solve these linear programs.) Finally, state the weak
duality theorem and the strong dua
CS 601 Pre-test
Spring 2011
Name _
1. The divide-and-conquer algorithm shown below takes an arbitrarily-ordered array A[1n], and
returns its smallest value. Write a recurrence equation for the running time T(n) of this
algorithm, and also solve the recurr