hbs3 - Problem 3. [Divide and Conquer] Let p = ( x,y ) and...

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

View Full Document Right Arrow Icon
CS 473: Algorithms, Fall 2010 HBS 3 Problem 1. [Recurrences] Solve the following recurrences. T ( n ) = 5 T ( n/ 4) + n and T ( n ) = 1 for 1 n < 4. T ( n ) = 2 T ( n/ 2) + nlogn T ( n ) = 2 T ( n/ 2) + 3 T ( n/ 3) + n 2 Problem 2. [Tree Traversal] Let T be a rooted binary tree on n nodes. The nodes have unique labels from 1 to n . Given the preorder and postorder node sequences for T , give a recursive algorithm to re- construct a tree that satisfies the preorder and postorder sequences. Is this reconstruction unique? Given the preorder and inorder node sequences for T , give a recursive algorithm to reconstruct a tree that satisfies the preorder and inorder sequences. Is this reconstruction unique?
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Problem 3. [Divide and Conquer] Let p = ( x,y ) and p = ( x ,y ) be two points in the Euclidean plane given by their coordinates. We say that p dominates p if and only if x &gt; x and y &gt; y . Given a set of n points P = { p 1 ,...,p n } , a point p i P is undominated in P if there is no other point p j P such that p j dominates p i . Describe an algorithm that given P outputs all the undominated points in P ; see gure. Your algorithm should run in time asymptotically faster than O ( n 2 ) Figure 1: The undominated points are shown as unlled circles. 1...
View Full Document

Ask a homework question - tutors are online