This preview shows page 1. Sign up to view the full content.
Unformatted text preview: n elements has worstcase time complexity O ( log ( n )) . (d) Inserting n elements into an unsorted linked list can be done in worstcase time O(n) . 3. What is the time complexity of the code below? Choose the tightest bound. int count = 0; for(int i = 0; i < n + 5; i++){ for(int j = 0; j < n*n*n; j++){ count++; } } (a) O( n 4 ) (b) O( n 3 ) (c) O( n 2 ) (d) O( n ) 4. Which of these is a design pattern? (a) Scientist (b) Observer (We gave everyone this point as it wasnt covered in class before the quiz) (c) Sniper (d) Engineer 1...
View Full
Document
 Spring '07
 FRANCIS

Click to edit the document details