fin06f - Last Name _ First Name _ McGill ID _ McGill...

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

View Full Document Right Arrow Icon
Last Name _____________________________________ First Name _____________________________________ McGill ID ______________________________________ McGill University Computers in Engineering COMP-208 Final Examination Friday, December 15, 2006 2:00 –5:00 P. M. Examiner: Prof. N. Friedman Associate Examiner: Prof. Yi Lin This is a closed book, multiple-choice exam to be answered using the mark sense sheets for Questions 1 to 20. Questions 1 to 6 are worth 2% each, questions 7 to 14 are worth 3% each and questions 15- 20 are worth 4% each. Questions 21 and 22 (worth 20% each) are to be answered in the exam booklets provided. The Examination Security Monitor program detects pairs of students with unusually similar answer patterns on multiple-choice exams. Data generated by this program can be used as admissible evidence, either to corroborate an investigation or a charge of cheating under Section 16 of the Code of Student Conduct and Disciplinary Procedures. This exam paper and the booklet must be returned. This exam consists of 12 pages. Faculty standard calculators are allowed. Grading: Question Possible Points Your Grade 1-6 2 marks each 7-14 3 marks each 15-20 4 marks each 21 20 22 20 Total 100 COMP 208 1 of 1 December 15, 2006 Final Examination Version 1
Background image of page 1

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

View Full DocumentRight Arrow Icon
Question 1 Header files are included in C programs to: a) Make the program easier to debug b) Allow the program to run on different computers c) Allow recursive functions d) Allow the program to use functions in libraries e) None of the above Question 2 Which of the following are valid function prototypes in C? 1. typedef double (*g) (int, int, double); 2. double (*g) (int, int, double); 3. double g (int, int, double); 4. double g (int x, int y, double z); a) 3, 4 b) 1, 2, 3 c) 2, 3 d) 2, 3, 4 e) 1, 3, 4 Question 3 Which of the following statements about Bubble Sort is false? a) There are n passes through the array in the worst case b) Pass j (inner for loop) takes n-j steps c) The total number of steps is O(n 2 ) in the worst case d) The total number of steps of the optimized version is O(nlog(n)) in the worst case e) After j passes, at least j values are in the correct order Question 4 If a binary search of an array A between left and right terminates with left>right a) The value we are searching for is at A[mid] b) The value we are searching for is not in the array c) An error has occurred d) No action is taken e) The search starts over COMP 208 2 of 2 December 15, 2006 Final Examination Version 1
Background image of page 2
Question 5 Which of the following statements are false? 1.
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 01/15/2010 for the course COMP COMP 206 taught by Professor Vybihal during the Spring '04 term at McGill.

Page1 / 12

fin06f - Last Name _ First Name _ McGill ID _ McGill...

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