This preview shows pages 1–3. Sign up to view the full content.
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 worst-case 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
- Spring '12