06Fall - CSE 2320 Name _ Test 1 Fall 2006 Last 4 Digits of...

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 Fall 2006 Last 4 Digits of Student 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. What happens in the third phase of counting sort? A. Add to appropriate counter for each key B. Clear count table C. Copy each record to output D. Determine first slot for each range value 3. Which of the following sorts is not stable? A. Insertion B. LSD Radix Sort C. M ERGE -S ORT D. Q UICKSORT 4. Suppose H n = 137 60 . What is the value of n ? A. 4 B. 5 C. 6 D. 7 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. Which of the following facts cannot be proven using one of the limit theorems? A. n 2 Î O n 3 ae è ç ö ø ÷ B. n 2 Î W n log n ( ) C. g n ( ) Î Q f n ( ) ( ) Û f n ( ) Î Q g n ( ) ( ) D. 3 n Î W 2 n ae è ç ö ø ÷ 7. 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 8. 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 è ç ö ø ÷ 9. The worst-case time for Q UICKSORT for n keys is in which set? A. Θ log n ( ) B. Θ n ( ) C. Θ n log n ( ) D. Θ n 2 ae è ç ö ø ÷ 10. How many inversions occur in the sequence 1 3 0 6 5 2 4 7? A. 7 B. 8 C. 9 D. 11 11. 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 ( ) ( ) 12. 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 è ç ö ø ÷ 13. An array with 1000 unique elements is subscripted starting with 0. You would like to iteratively use P ARTITION to find the twenty largest values, but there is no requirement that the twenty largest values be ordered. Which of the following is not correct? A. If 978 is returned from P ARTITION , we are done. B. If 979 is returned from P ARTITION , we are done.
Background image of page 1

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

View Full DocumentRight Arrow Icon
C. If 980 is returned from P ARTITION , we are done. D. If 981 is returned from P ARTITION , we must continue. 14. Suppose a minheap that can hold m records is used to produce sorted subfiles for an external mergesort. In the worst case, the number of records in a subfile (except the last one) is: A. m B. 2 m C. m ln m D. m
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.

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.

Page1 / 10

06Fall - CSE 2320 Name _ Test 1 Fall 2006 Last 4 Digits of...

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