cs320-2010-t1-midterm1-solution

cs320-2010-t1-midterm1-solution - CPSC 320 Midterm 1...

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

View Full Document Right Arrow Icon
CPSC 320 Midterm 1 Monday, October 18th, 2010 [13] 1. Short answers [4] a. We frequently prove an O ( n 2 ) bound on the worst-case running time T ( n ) of an algorithm, without proving any Ω bound on T ( n ) . However, we would never prove an Ω( n 2 ) bound on T ( n ) without also proving a O bound on T ( n ) . Why not? Solution : Proving an Ω( n 2 ) bound on T ( n ) simply means that the algorithm runs slowly. There is no point in giving an algorithm without providing an upper-bound on its running time (since then the algorithm might be arbitrarily bad). [4] b. Why is Dijkstra’s algorithm greedy? Solution : Because at each iteration of the for loop, it adds to the tree the vertex with the smallest cost at that point, without considering what that might mean for future iterations. [5] c. Mr. Isulo, a famous alien computer scientist, has designed a greedy algorithm to solve the Clique problem (you don’t need to know what it is) on a type of graphs called circular arc graphs (you don’t need to know what they are either). His algorithm starts by choosing the vertex with the most neighbours. Mr. Isulo wants to prove the following lemma: “Every circular arc graph has a max- imum clique that contains the vertex with the most neighbours”, but he eventually finds a counter-example to his conjecture. What does this imply for Mr. Isulo’s algo- rithm, and why? Solution :
Background image of page 1

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

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

This note was uploaded on 10/09/2011 for the course CPSC 344 taught by Professor Karen during the Fall '10 term at The University of British Columbia.

Page1 / 4

cs320-2010-t1-midterm1-solution - CPSC 320 Midterm 1...

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

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