{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

09Summer

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

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

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 æ è ç ö ø ÷ D. Θ n 3 æ è ç ö ø ÷ 2. The number of calls to getmin to build a Huffman code tree for n symbols is: 3. Which of the following is not true? 4. When solving the activity scheduling problem (unweighted interval scheduling), the intervals are processed in the following order. 5. The function n 2 + 3 n log n is in which set? A. n 2 æ è ç ö ø ÷ B. Θ log n ( ) C. Θ n ( ) D. Θ n log n ( ) 6. log n ! ( ) is in all of the following sets, except 7. To sort a sub-array with n items using recursive (top-down) mergesort, how many calls to mergeSort() are needed?

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

View Full Document
8. What is indicated when find(i)==find(j) while maintaining disjoint subsets? 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 æ è ç ö ø ÷ . Which of the following cannot be shown as an improvement? 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 ) æ è ç ö ø ÷ . 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
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 æ è ç ö ø ÷ . 10 points 4. Use the substitution method to show that T n ( ) = 4 T n 2 ( ) + n 2 is in Θ n 2 log n æ è ç ö ø ÷ . 10 points 5.

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### 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
Ask a homework question - tutors are online