This preview shows pages 1–2. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: CAS 702 Data Structures and Algorithms Final Exam 60p December 8, 2008 duration of the exam: 3 hours Name: Student Number: Signature: Problem 1 a. Prove that (lg n ) b = O ( n a ) where a and b are strictly positive constants. 5p b. Show how can the output of the FloydWarshall algorithm be used to detect the presence of a negativeweight cycle on a simple directed graph. 5p c. Assuming that the best running time of a comparison based algorithm to sort n elements is ( n lg n ), prove that the running time of constructing a binary search tree from an arbitrary list of n elements can not be ( n ). 5p Problem 2 Consider a function = c + n i =1 c i x i + 1 i<j n c ij x i x j where c , c i , and c ij are given constant coefficients, and x i { , 1 } . First, can be transformed into an equivalent form + such that all the coefficients are nonnegative by replacing some x i by 1 x i (note that x i { , 1 } ). Then, by replacing some x i and x i by 1...
View
Full
Document
This note was uploaded on 10/26/2009 for the course CAS 702 taught by Professor Zera during the Fall '09 term at McMaster University.
 Fall '09
 Zera

Click to edit the document details