{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

# hbs3 - Problem 3[Divide and Conquer Let p = x,y and p = x,y...

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

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?
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 > x and y > 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 unﬁlled circles. 1...
View Full Document

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern