hw2(1) - CS 373 Combinatorial Algorithms Fall 2000 Homework...

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

View Full Document Right Arrow Icon
CS 373: Combinatorial Algorithms, Fall 2000 Homework 2 (due September 28, 2000 at midnight) Name: Net ID: Alias: U 3 / 4 1 Name: Net ID: Alias: U 3 / 4 1 Name: Net ID: Alias: U 3 / 4 1 Starting with Homework 1, homeworks may be done in teams of up to three people. Each team turns in just one solution, and every member of a team gets the same grade. Since 1-unit graduate students are required to solve problems that are worth extra credit for other students, 1-unit grad students may not be on the same team as 3/4-unit grad students or undergraduates. Neatly print your name(s), NetID(s), and the alias(es) you used for Homework 0 in the boxes above. Please also tell us whether you are an undergraduate, 3/4-unit grad student, or 1-unit grad student by circling U, 3 / 4 , or 1, respectively. Staple this sheet to the top of your homework. Required Problems 1. Faster Longest Increasing Subsequence (15 pts) Give an O ( n log n ) algorithm to find the longest increasing subsequence of a sequence of numbers. [Hint: In the dynamic programming solution, you don’t really have to look back at all previous items. There was a practice problem on HW 1 that asked for an O ( n 2 ) algorithm for this. If you are having difficulty, look at the HW 1 solutions.] 2. S ELECT (A, k) (10 pts) Say that a binary search tree is augmented if every node v also stores | v | , the size of its subtree. (a) Show that a rotation in an augmented binary tree can be performed in constant time. (b) Describe an algorithm S CAPEGOAT S ELECT ( k ) that selects the k th smallest item in an augmented scapegoat tree in O (log n ) worst-case time. (c) Describe an algorithm S PLAY S ELECT ( k ) that selects the k th smallest item in an aug- mented splay tree in O (log n ) amortized time.
Image of page 1

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

View Full Document Right Arrow Icon
CS 373 Homework 2 (due 9/28/00) Fall 2000
Image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    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.

    Student Picture

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

  • Left Quote Icon

    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.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    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.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern