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 14, 2007 duration of the exam: 3 hours Name: Student Number: Signature: Problem 1 a. Prove or disprove the following: f ( n ) = ( f ( n/ 2)). 5p b. Consider the following: An array of n numbers contains only 1 , 0 and 1 can be sorted in O ( n ) time in the worst case. If true , describe an O ( n ) time algorithm briefly (you are not required to prove its correctness), if false give the correct worst case running time. 5p c. Prove or disprove the following: If a node in a binary search tree has two children, then its successor has no left child and its predecessor has no right child. 5p Problem 2 Consider a positive flow f in a network G = ( V,E ). We wish to decompose f into positive simple path (or cycle) flows f i , i.e. f = f i , where the edges of f i form a simple path form s to t in G , or any cycle in G . (Recall: a simple path has no repeated vertices, and a simple cycle has no repeated vertices aside from the start/end vertex).has no repeated vertices aside from the start/end vertex)....
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