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 wasn’t covered in class before the quiz) (c) Sniper (d) Engineer 1...
View
Full
Document
This note was uploaded on 09/17/2011 for the course CS 2110 taught by Professor Francis during the Spring '07 term at Cornell.
 Spring '07
 FRANCIS

Click to edit the document details