{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

final-s2008

final-s2008 - 6.006 Spring 2008 Final Exam Introduction to...

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

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

View Full Document
6.006 Final Exam Name 2 Problem 1. Asymptotics [10 points] For each pair of functions f ( n ) and g ( n ) in the table below, write O , Ω , or Θ in the appropriate space, depending on whether f ( n ) = O ( g ( n )) , f ( n ) = Ω( g ( n )) , or f ( n ) = Θ( g ( n )) . If there is more than one relation between f ( n ) and g ( n ) , write only the strongest one. The first line is a demo solution. We use lg to denote the base-2 logarithm. n n lg n n 2 n lg 2 n Ω Ω O 2 lg 2 n lg( n !) n lg 3
6.006 Final Exam Name 3 Problem 2. True or False [40 points] (10 parts) Decide whether these statements are True or False . You must briefly justify all your answers to receive full credit. (a) An algorithm whose running time satisfies the recurrence P ( n ) = 1024 P ( n/ 2) + O ( n 100 ) is asymptotically faster than an algorithm whose running time satisfies the recurrence E ( n ) = 2 E ( n - 1024) + O (1) . True False Explain: (b) An algorithm whose running time satisfies the recurrence A ( n ) = 4 A ( n/ 2) + O (1) is asymptotically faster than an algorithm whose running time satisfies the recurrence B ( n ) = 2 B ( n/ 4) + O (1) . True False Explain:

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

View Full Document
6.006 Final Exam Name 4 (c) Radix sort works in linear time only if the elements to sort are integers in the range { 0 , 1 , . . . , c n } for some c = O (1) .
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}