

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Cs 2605 homework 6 from summer i 2007. The assignment includes tasks on complexity analysis of a function, finding the smallest value of n for given inequalities, function classification, and deciding the order of certain statements. Students are required to submit their solutions as plain text files or ms word documents.
Typology: Assignments
1 / 2
This page cannot be seen from the preview
Don't miss anything!


CS 2605 Homework 6 Summer I 2007
Last modified: 6/22/2007 11:06:52 AM 1
You will submit your solution to this assignment to the Curator System (as HW6). Your solution must be either a plain text file
or a MS Word document.
following function. (Your answer should be a function of the parameter N.)
void Mystery(int M[N][N], const int N) {
for (int R = 0; R < N; R++) { for (int C = 1; C < N; C++) { if (M[R][C-1] < M[R][C]) M[R][C-1] = M[R][C]; else { M[R][C] = M[R][C-1]; M[R][C-1] = 0; } } } }
Note: array index operations count 1 time unit each.
= N?
(a) 0. 1 n ≥ 10 log n
(b) n n 20 n log n 2
functions, say f(n) and g(n), are in the same category if and only if f(n) is Θ(g(n)). Arrange the categories from the lowest order of magnitude to the highest. A function may be in a category by itself, or there may be several functions in the same category.
5000 (log n)
5 3
n
log n n + log n n
3
n
2 log n n
2
1/
log log n
2 n
n
2
log n
2 (n
2
1/ 2
n
2 n − n + n + n Θ n
CS 2605 Homework 6 Summer I 2007
Last modified: 6/22/2007 11:06:52 AM 2
3 n − n + n Θ n
(b) 10 100 is ( )
2 n − n + Ω n
(c) 2 is ( )
3 4 n n
n − Ω
How long would it take to execute this algorithm on hardware capable of carrying out 2^23 instructions per second if N = 230? (Give your answer in hours, minutes and seconds, to the nearest second.)