COMP 250 Study Guide - Final Guide: Sorting Algorithm, Hash Table, Simple Algorithm

165 views16 pages

Document Summary

Comp-250: introduction to computer science - winter 2006. Write your name at the top of this page. Three blank pages are added at the end in case you need extra space. There are 10 questions worth 100 points in total. The value of each question is found in parentheses next to it. Please write your answer on the provided exam. Partial credit will be given for incomplete or partially correct answers. Page 2 of 16: [30 points, 3 points each] short questions. Indicate whether the following statements are true or false. Then a is always preferred to b. (d) problems in the class p are also part of the class np. (e) suppose i have a hash table with 50 buckets. Then i cannot store more than 50 items in this hash table. Page 4 of 16: [10 points] a simple algorithm. You are given an array of n positive integers. The numbers do not appear in any particular order.