{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

quiz1_practice

quiz1_practice - 6.046 Fall 2004 Quiz Reviewfrom 6.046...

This preview shows page 1. Sign up to view the full content.

6.046 Fall 2004 Quiz Review—from 6.046 Spring 2002: 1. Recurrences (20 points) Solve the following recurrences (provide only the �() bounds). You can assume T ( n ) = 1 for n smaller than some constant in all cases. You do not have to provide justifications, just write the solutions. T ( n ) = T ( n/ 7) + 1 T ( n ) = 3 T ( n/ 3) + n T ( n ) = 5 T ( n/ 5) + n log n T ( n ) = 10 T ( n/ 3) + n 1 . 1 2. True or False, and Justify (32 points) Circle T or F for each of the following statements to indicate whether the statement is true or false, respectively. If the statement is correct, brieﬂy state why. If the statement is wrong, explain why. Your justification is worth more points than your true-or-false designation. T F The solution to the recurrence T ( n ) = T ( n/ 3) + T ( n/ 6) + n log n is T ( n ) = �( n log n ) (assume T ( n ) = 1 for n smaller than some constant c ). T F Radix sort works in linear time only if the elements to sort are integers in the range { 1 . . . cn } , for some c = O (1). T F There exists a comparison-based sorting algorithm that can sort any 6-element array using at most 9 comparisons.
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

Ask a homework question - tutors are online