hw2-629-10b

hw2-629-10b - DELETE, SEARCH and MIN-GAP as ecient as...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
CSCE 629 Homework 2 June 9, 2010 Homework 2 is due Wednesday, June 16 in class. Read chapters 13-14. Turn in 1. Exercise 13.3-5, page 322 (Consider a red-black tree formed by inserting n nodes with RB-INSERT. Argue that is n is greater than 1, the tree has at least one red node.) 2. Problem 13-3, page 333 (AVL trees) 3. Would it be possible to maintain efficiently a new Feld b-des(x)in a red-black tree which for a node x in the tree contains the number of black descendants of x? What about a new Feld b-anc(x) which contains the number of black ancestors of x? Justify your answers. 4. Exercise 14.3-6, page 354 (Show how to maintain a dynamic set Q of numbers that supports the operation MIN-GAP which gives the magnitude of the di±erence of the two closest numbers in Q. Make the operations INSERT,
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: DELETE, SEARCH and MIN-GAP as ecient as possible and analyze their running times.) 5. Suppose you want to maintain a set of dynamic intervals (i.e. there are insertions into and deletions from the set) in order to be able to query eciently whether a given interval contains any of the intervals in the set. What data structure would you want to use and what information would need to be stored? Describe an algorithm for implementing the query in sucient detail so that you can analyze the time required to respond to the query. Show that the extra information you need can be maintained during the insertions and deletions. 1...
View Full Document

This document was uploaded on 03/23/2011.

Ask a homework question - tutors are online