CS250-Final-2005

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

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

View Full Document Right Arrow Icon
1 COMP 250-A Final examination, Fall 2005 NAME: STUDENT NUMBER: . Faculty of Science FINAL EXAMINATION COMP-250 A – Introduction to Computer Science School of Computer Science, McGill University Examimer: Prof. Mathieu Blanchette December 8 th 2005, 14:00-17:00 Associate examiner: Prof. Prakash Panangaden INSTRUCTIONS Write your name at the top of this page. Answer directly on exam paper. Three blank pages are added at the end in case you need extra space. This examination is worth 50% of your final grade. The total of all questions is 100 points. The value of each question is found in parentheses next to it. This is an open book exam though sharing materials with other students is not permitted. No electronic devices, calculator, laptop computer, cell phones, etc. are allowed. All logs are in base 2. This exam comprises 14 pages, including the cover page and three blank pages at the end. SUGGESTIONS: READ ALL THE QUESTIONS BEFORE YOU START! THE NUMBER OF POINTS IS NOT ALWAYS PROPORTIONAL TO THE DIFFICULTY OF THE QUESTIONS. SPEND YOUR TIME WISELY! GOOD LUCK! Grading scheme: 1. / 30 2. / 12 3. / 10 4. / 6 5. / 12 6. / 10 7. / 10 8. / 10 Total. / 100
Background image of page 1

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

View Full DocumentRight Arrow Icon
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)).
Background image of page 2
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)
Background image of page 3

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

View Full DocumentRight Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 05/06/2010 for the course CS COMP250 taught by Professor Blanchette during the Fall '09 term at McGill.

Page1 / 16

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

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

View Full Document Right Arrow Icon
Ask a homework question - tutors are online