This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: CSE 2320 Name ____________________________________ Test 1 Fall 2008 Last 4 Digits of Mav ID # _____________________ Multiple Choice. Write your answer to the LEFT of each problem. 3 points each 1. The time to compute the sum of the n elements of an integer array is in: A. Θ n ( ) B. Θ n log n ( ) C. Θ n 2 ae è ç ö ø ÷ D. Θ n 3 ae è ç ö ø ÷ 2. When solving the fractional knapsack problem, the items are processed in the following order. A. Ascending order of weight B. Ascending order of $$$/lb C. Descending order of weight D. Descending order of $$$/lb 3. Suppose the input to H EAPSORT is always a table of identical integers. The worstcase time will be A. Θ 1 ( ) B. Θ n ( ) C. Θ n log n ( ) D. Θ n 2 ae è ç ö ø ÷ 4. What is the definition of H n ? A. Θ n ( ) B. k k =1 n å C. ln n D. 1 k k =1 n å 5. The function n + log n is in which set? A. Ω n log n ( ) B. Θ log n ( ) C. Θ n ( ) D. Θ n log n ( ) 6. Which of the following is not true? A. n 2 Î W n 3 ae è ç ö ø ÷ B. n log n Î O n 2 ae è ç ö ø ÷ C. g n ( ) Î O f n ( ) ( ) Û f n ( ) Î W g n ( ) ( ) D. log n Î W loglog n ( ) 7. Suppose a binary search is to be performed on a table with 20 elements. The maximum number of elements that could be examined (probes) is: A. 4 B. 5 C. 6 D. 7 8. Which of the following functions is not in Ο n 2 ae è ç ö ø ÷ ? A. n B. n lg n C. n 2 D. n 3 9. Which statement is correct regarding the unweighted and weighted activity scheduling problems? A. Both require dynamic programming B. Both are easily solved using a greedy technique C. Unweighted is solved using a greedy technique, weighted is solved by dynamic programming D. Weighted is solved using a greedy technique, unweighted is solved by dynamic programming 10. What is required when calling union(i,j) for maintaining disjoint subsets? A. i and j are in the same subset B. i and j are leaders for different subsets C. i and j are leaders for the same subset D. i is the ancestor of j in one of the trees 11. 4 lg7 evaluates to which of the following? (Recall that lg x = log 2 x .) A. 7 B. 7 C. 30 D. 49 12. Suppose you are using the substitution method to establish a Θ bound on a recurrence T n ( ) and you already know that T n ( ) Î W log n ( ) and T n ( ) Î O n 3 ae è ç ö ø ÷ . Which of the following cannot be shown as an improvement? A. T n ( ) Î O 1 ( ) B. T n ( ) Î O log n ( ) C. T n ( ) Î W n 2 ae è ç ö ø ÷ D. T n ( ) Î W n 3 ae è ç ö ø ÷ 13. What is the value of 2 k k =0 t å ? A. 2 k B. 2 t C. 2 t +1 1 D. 2 t +1 +1 14. Suppose that you have correctly determined some c and n o to prove g n ( ) Î W f n ( ) ( ). Which of the following is not necessarily true?...
View
Full
Document
This note was uploaded on 03/25/2012 for the course CSE 2320 taught by Professor Bobweems during the Spring '12 term at UT Arlington.
 Spring '12
 BOBWEEMS

Click to edit the document details