This preview shows pages 1–3. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: Spring 2007 CSE310 Midterm Examination 01B (in class) Instructions: • There are five problems in this paper. Please use the space provided (below the ques tions) to write the answers. • Budget your time to solve various problems (roughly 15 minutes for each problem) and avoid spending too much time on a particular question. • This is a closed book examination. You may not consult your books/notes. NAME ASUID Question Score P1 P2 P3 P4 P5 Total Problem 1B. (20 points: 4 + 4 + 4 + 4 + 4) Use O , Ω, or Θ to relate each of the following pairs of functions. In particular, you need to write your answer as f ( n ) = O ( g ( n )), f ( n ) = Ω( g ( n )), or f ( n ) = Θ( g ( n )). In case f ( n ) = Θ( g ( n )), you will not receive credit if you write f ( n ) = O ( g ( n )) or f ( n ) = Ω( g ( n )), although both are implied by f ( n ) = Θ( g ( n )). 1. f ( n ) is the average case time complexity of mergesort for sorting n elements. g ( n ) is the average case time complexity of quicksort for sorting n elements. f ( n ) = Θ( g ( n )). Grading is binary. 2. f ( n ) is the worst case time complexity of mergesort for sorting n elements. g ( n ) is the worst case time complexity of quicksort for sorting n elements. f ( n ) = O ( g ( n )). Grading is binary. 3. f ( n ) = n X i =1 i ( i + 1) , g ( n ) = n 3 + n X i =1 i 2 i . f ( n ) = Θ( g ( n )). Grading is binary. 4. f ( n ) = n n , g ( n ) = 2 n × 3 n ....
View
Full
Document
This note was uploaded on 02/27/2011 for the course CSE 310 taught by Professor Davulcu,h during the Spring '08 term at ASU.
 Spring '08
 Davulcu,H
 Algorithms, Data Structures

Click to edit the document details