fin07f.v1 - December 2007 Final Examination VERSION 1 COMP...

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

View Full Document Right Arrow Icon
December 2007 Final Examination VERSION 1 COMP 208 -- Computers in Engineering Wednesday, December 19, 2007 9:00 – 12:00 A.M. Examiner: Prof. Nathan Friedman Assoc Examiner: Prof. Tim Merrett Student Name: McGill ID: INSTRUCTIONS: This is a CLOSED BOOK examination. This examination consists of 20 multiple choice questions and 2 (two) programming questions, for a total of 22 questions. o 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 initiate or corroborate an investigation or a charge of cheating under Section 16 of the Code of Student Conduct and Disciplinary Procedures. Mark your multiple choice answers on the computer sheet using PENCIL ONLY. Answer questions 21 and 22 in the examination booklet provided. The examination consists of 13 pages including the cover page. FACULTY STANDARD CALCULATOR permitted ONLY. This examination paper and answer booklets MUST BE RETURNED Grading: o Questions 1 – 20 are worth 3 marks each o Questions 21 and 22 are worth 20 marks each COMP 208 1 of 1 December 19, 2007 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 Which of the following statements (a-d) is false ? a) Programs written in a high level language are translated into assembly or machine level programs before being executed. b) Compilers do not translate comments. c) A compiler is a specialized text editor that uses indentation or colours to make the code easier to read d) A program is stored in memory by a loader before being executed e) All of these statements are true. Question 2 Consider an array containing {7, 6, 4, 20, 1, 22, 3, 8} Suppose the selection sort algorithm is used to sort this array into increasing order from left to right. What will be the arrangement of the elements after the first three passes? a) 4, 6, 7, 20, 1, 22, 3, 8 b) 1, 3, 4, 7, 6, 8, 20, 22 c) 1, 3, 4, 20, 7, 22, 6, 8 d) 4, 6, 7, 20, 1, 3, 8, 22 e) None of the above Question 3 Consider an array containing {7, 6, 4, 20, 1, 22, 3, 8} Suppose the optimized version of the bubble sort algorithm is used to sort this array into increasing order from left to right. How many passes will the algorithm make through the array? a) 3 b) 5 c) 7 d) 8 e) None of the above COMP 208 2 of 2 December 19, 2007 Final Examination Version 1
Background image of page 2
Question 4 The following is a partial implementation of insertion sort. The expression that controls the execution of the inner loop is missing and is labeled condition . void insertion(int arr[], int size){
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 / 13

fin07f.v1 - December 2007 Final Examination VERSION 1 COMP...

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