final(2) - CS 373 Final Exam Questions (May 7, 2001) Spring...

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

View Full Document Right Arrow Icon

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

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

Unformatted text preview: CS 373 Final Exam Questions (May 7, 2001) Spring 2001 You must turn in this question sheet with your answers. 1. Dej`a vu Prove that any positive integer can be written as the sum of distinct nonconsecutive Fibonacci numbersif F n appears in the sum, then neither F n +1 nor F n- 1 will. For example: 42 = F 9 + F 6 , 25 = F 8 + F 4 + F 2 , and 17 = F 7 + F 4 + F 2 . You must give a complete, self-contained proof, not just a reference to the posted homework solutions. 2. Lesprit descalier Recall that the staircase of a set of points consists of the points with no other point both above and to the right. Describe a method to maintain the staircase as new points are added to the set. Specifically, describe and analyze a data structure that stores the staircase of a set of points, and an algorithm INSERT ( x,y ) that adds the point ( x,y ) to the set and returns TRUE or FALSE to indicate whether the staircase has changed. Your data structure should use O ( n ) space, and your INSERT algorithm should run in O (log n ) amortized time....
View Full Document

Page1 / 2

final(2) - CS 373 Final Exam Questions (May 7, 2001) Spring...

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