{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

hw1 - 15-750 HW 1 1 15-750 Graduate Algorithms Spring 2009...

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

View Full Document Right Arrow Icon
15-750 HW 1 1 15-750 — Graduate Algorithms — Spring 2009 Miller and Dinitz and Tangwongsan Assignment 1 Due date: Friday, February 6 Some Reminders: Read the Policies section on the course web site before you start working on this assignment. Collab- oration is permitted for this assignment; however, you must write up your own solutions. When solving these problems, you should refrain from looking up solutions from outside sources; however, you should feel free to look up, say, Markov’s inequality or isoperimetric bounds. For each problem, state whether you have seen it before. If you have questions, contact the course staff. We strongly encourage you to type up your solutions (preferably using LaTeX). Extra-credit will be given if we use your wonderful write-up in our solutions. You may neatly hand-write your solutions, but if we have trouble reading them, you will be required to type up future solutions. When you give an algorithm, please also explain why it is correct and analyze its running time. Start EARLY! We really, really want to encourage you to start working on this assignment early and take full advantage of office hours. This is your first full-length assignment for this class. 1 Fibonaccimal Numbers (25 pts.) Suppose instead of using powers of two, we now represent integers as the sum of Fibonacci numbers. That is, rather than representing a number as an array of bits, we keep an array of “fibbits” so that ( x k x k - 1 . . . x 1 ) F denotes the number k i =1 x i F i . As an example, the Fibonaccimal number (1101) F = F 4 + F 3 + F 1 = 1 + 2 + 3 = 6. Recall that the Fibonacci numbers satisfy the recurrence F 0 = 0 , F 1 = 1 and F n +2 = F n +1 + F n . a) Show that every positive integer n can be represented as a Fibonaccimal number. b) Give an algorithm to increment a Fibonaccimal number in constant amortized time. 2 Cheating with Heaps (25 pts.) In class, we have seen a number of data structures for maintaining priority queues. These data structures typically take O (log n ) (amortized) time to locate and remove the minimum element. It is also known that sorting n numbers (in the comparison model) requires Ω( n
Background image of page 1

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

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

{[ snackBarMessage ]}