09Summer - CSE 2320 Test 1 Summer 2009 Name _ Last 4 Digits...

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

View Full Document Right Arrow Icon
CSE 2320 Name ____________________________________ Test 1 Summer 2009 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. 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 Î O n 3 ae è ç ö ø ÷ B. n log n Î W n 2 ae è ç ö ø ÷ C. g n ( ) Î O f n ( ) ( ) Û f n ( ) Î W g n ( ) ( ) D. 3 n Î W 2 n ae è ç ö ø ÷ 4. When solving the activity scheduling problem (unweighted interval scheduling), the intervals are processed in the following order. A. Ascending order of finish time B. Ascending order of start time C. Descending order of interval length D. Descending order of finish time 5. The function n 2 + 3 n log n is in which set? A. n 2 ae è ç ö ø ÷ B. Θ log n ( ) C. Θ n ( ) D. Θ n log n ( ) 6. log n ! ( ) is in all of the following sets, except A. log n ( ) B. Θ n log n ( ) C. n 2 ae è ç ö ø ÷ D. Ο n 2 ae è ç ö ø ÷ 7. To sort a sub-array with n items using recursive (top-down) mergesort, how many calls to mergeSort() are needed?
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. n – 1 B. n C. 2 n - 1 D. 2 n - 2 8. What is indicated when find(i)==find(j) while 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 9. 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? 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 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 è ç ö ø ÷ Short Answer. 3 points each 1. Give the definition of H n . 2. Suppose a binary search is to be performed on a table with 60 elements. The maximum number of elements that could be examined (probes) is: 3. Give the subscripts for the parent, left child, and right child for the maxheap element stored at subscript 551. The heap is currently storing 1000 elements in a table with 2000 slots. 4. List the stable sorts we have studied so far. 5. Give a longest common subsequence for aabb and abab . Long Answer 1. Prove that if f ( n ) Î O g ( n ) ( ) then 1 f ( n ) Î W 1 g ( n ) ae è ç ö ø ÷ . 5 points 2. Use dynamic programming to solve the following instance of weighted interval scheduling. Be sure to indicate the intervals in your solution and the sum achieved. 10 points 2
Background image of page 2
1 6 11 16 21 26 1 2 3 4 5 6 7 8 9 10 v i p i 1 0 5 0 3 2 8 1 1 4 2 4 3 5 1 6 4 6 1 8 m ( i ) 3. Use the recursion-tree method to show that T n ( ) = 4 T n 2 ( ) + n 2 is in Θ n 2 log n ae è ç ö ø ÷ . 10 points 4. Use the substitution method to show that T n ( ) = 4 T n 2 ( ) + n 2 is in Θ n 2 log n ae è ç ö ø ÷ . 10 points 5.
Background image of page 3

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

View Full DocumentRight Arrow Icon
Image of page 4
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 / 14

09Summer - CSE 2320 Test 1 Summer 2009 Name _ Last 4 Digits...

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

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