08Spring - CSE 2320 Name _ Test 1 Spring 2008 Last 4 Digits...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
CSE 2320 Name ____________________________________ Test 1 Spring 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: A. Θ n ( ) B. Θ n log n ( ) C. Θ n 2 ae è ç ö ø ÷ D. Θ n 3 ae è ç ö ø ÷ 2. The number of calls to getmin to build a Huffman code tree for n symbols is: A. Θ log n ( ) B. n - 1 C. n D. 2 n - 2 3. 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. 3 n Î W 2 n ae è ç ö ø ÷ 4. For an instance of the subset sum problem, n positive integer values and another positive integer m are given. The time for the dynamic programming solution is: A. Θ m + n ( ) B. Θ m ( ) C. Θ n ( ) D. Θ mn ( ) 5. The function 2 n + log n is in which set? A. n log n ( ) B. Θ log n ( ) C. Θ n ( ) D. Θ n log n ( ) 6. f n ( ) = n lg n is in all of the following sets, except A. Ο log n ( ) B. Θ log n ! ( ) ( ) C. n ( ) D. Ο n 2 ae è ç ö ø ÷ 7. Which statement is correct regarding the unweighted and weighted interval scheduling problems? A. Weighted is solved using a greedy technique, unweighted is solved by dynamic programming B. Unweighted is solved using a greedy technique, weighted is solved by dynamic programming C. Both are easily solved using a greedy technique D. Both require dynamic programming 8. The purpose of the binary searches used when solving the longest (monotone) increasing subsequence (LIS) problem is: A. to assure that the final solution is free of duplicate values B. to determine the longest possible increasing subsequence terminated by a particular input value C. to search a table that will contain only the LIS elements at termination D. to sort the original input 9. Suppose that you have correctly determined some c and n o to prove that g n ( ) Î W f n ( ) ( ) . Which of the following is not necessarily true? A. c may be decreased B. c may be increased C. n o may be increased D. f n ( ) Î O g n ( ) ( ) 10. Suppose you are using the substitution method to establish a Θ bound on a recurrence T n ( ) and you already know that T n ( ) Î Wlog 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 è ç ö ø ÷ 11. What is n , the number of elements, for the largest table that can be processed by binary search using no more than 7 probes? A. 31 B. 63 C. 64 D. 127 12. 4 lg7 evaluates to which of the following? (Recall that lg x = log 2 x .)
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
A. 7
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 9

08Spring - CSE 2320 Name _ Test 1 Spring 2008 Last 4 Digits...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online