ps5 - Introduction to Algorithms Massachusetts Institute of...

This preview shows pages 1–3. Sign up to view the full content.

Introduction to Algorithms October 24, 2005 Massachusetts Institute of Technology 6.046J/18.410J Professors Erik D. Demaine and Charles E. Leiserson Handout 16 Problem Set 5 MIT students: This problem set is due in lecture on Monday, October 31, 2005. The homework lab for this problem set will be held 2–4 P . M . on Sunday, October 30, 2005 . Reading: Chapter 14 and Skip List Handout. Both exercises and problems should be solved, but only the problems should be turned in. Exercises are intended to help you master the course material. Even though you should not turn in the exercise solutions, you are responsible for material covered in the exercises. Mark the top of each sheet with your name, the course number, the problem number, your recitation section, the date and the names of any students with whom you collaborated. Please staple and turn in your solutions on 3-hole punched paper . You will often be called upon to “give an algorithm” to solve a certain problem. Your write-up should take the form of a short essay. A topic paragraph should summarize the problem you are solving and what your results are. The body of the essay should provide the following: 1. A description of the algorithm in English and, if helpful, pseudo-code. 2. At least one worked example or diagram to show more precisely how your algorithm works. 3. A proof (or indication) of the correctness of the algorithm. 4. An analysis of the running time of the algorithm. Remember, your goal is to communicate. Full credit will be given only to correct solutions which are described clearly . Convoluted and obtuse descriptions will receive low marks. Exercise 5-1. Do Exercise 14.1-5 on page 307 of CLRS. Exercise 5-2. Do Exercise 14.2-1 on page 310 of CLRS. Exercise 5-3. Do Exercise 14.3-4 on page 317 of CLRS. Exercise 5-4. Do Problem 14.2 on page 318 of CLRS.

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

View Full Document
2 Handout 16: Problem Set 5 Problem 5-1. Skip Lists and B-trees Intuitively, it is easier to ﬁnd an element that is nearby an element you’ve already seen. In a dynamic-set data structure, a ﬁnger search from x to y is the following query: given the node in the data structure that stores the element x , and given another element y , ﬁnd the node in the data structure that stores y . Skip lists support fast ﬁnger searches in the following sense. (a) Give an algorithm for ﬁnger searching from x to y in a skip list. Your algorithm should run in O (lg(2+ | rank ( x ) rank ( y ) | )) time with high probability, where rank ( x ) denotes the current rank of element x in the sorted order of the dynamic set. When
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 02/01/2010 for the course COMPUTERSC 6.046J/18. taught by Professor Erikd.demaineandcharlese.leiserson during the Fall '05 term at MIT.

Page1 / 6

ps5 - Introduction to Algorithms Massachusetts Institute of...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online