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: 15-750 HW 1115-750 — Graduate Algorithms — Spring 2009Miller and Dinitz and TangwongsanAssignment 1Due date: Friday, February 6Some Reminders:•Read the Policies section on the course web site before you start working on this assignment. Collab-orationispermitted 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 eachproblem, state whether you have seen it before. If you have questions, contact the course staff.•Westronglyencourage you to type up your solutions (preferably using LaTeX). Extra-credit will begiven 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 andtake full advantage of office hours. This is your first full-length assignment for this class.1Fibonaccimal 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” sothat (xkxk-1...x1)Fdenotes the number∑ki=1xiFi. As an example, the Fibonaccimal number(1101)F=F4+F3+F1= 1 + 2 + 3 = 6. Recall that the Fibonacci numbers satisfy the recurrenceF= 0,F1= 1 andFn+2=Fn+1+Fn.a) Show that every positive integerncan be represented as a Fibonaccimal number.b) Give an algorithm to increment a Fibonaccimal number in constant amortized time.2Cheating with Heaps(25 pts.)In class, we have seen a number of data structures for maintaining priority queues. These datastructures typically takeO(logn) (amortized) time to locate and remove the minimum element. Itis also known that sortingnnumbers (in the comparison model) requires Ω(nlogn). Therefore,the priority-queue data structures we have are essentially the best one can hope for.the priority-queue data structures we have are essentially the best one can hope for....
View Full Document
This document was uploaded on 11/03/2009.
- Spring '09