{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

CS250-Final-2005

# CS250-Final-2005 - NAME STUDENT NUMBER Faculty of Science...

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

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

View Full Document
2 COMP 250-A Final examination, Fall 2005 Question 1. (30 points, 2 points each) Indicate whether the following statements are true or false. Give a two-line justification for each. Credits will be given only if the justification is correct. a) If f(n) is O( h(n) ) and g(n) is Ω ( h(n) ) , then f(n) g(n) is Θ ( (h(n)) 2 ). b) 2 ( 2 log(n) ) is O( n ). c) To prove that f(n) is O( g(n) ), all one needs to do is to show that there exists a number n 0 such that f(n 0 ) c g(n 0 ), for some constant number c . d) Although many sorting algorithms have average-case running time O( n log( n ) ), they all have worst-case running time O( n 2 ). e) Suppose that a hash table has K buckets, the buckets are dictionaries implemented with a balanced binary search tree, and the hash table contains a total of N elements. Then, under the best possible choice of hash function, any find(key) operation will take time O(N/K log (N/K)).
3 COMP 250-A Final examination, Fall 2005 f) If it was possible to write a “merge” algorithm that would run in time O( n ), then the running time of mergeSort would be O( n ). g)

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 16

CS250-Final-2005 - NAME STUDENT NUMBER Faculty of Science...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online