The.Algorithm.Design.Manual.Springer-Verlag.1998

The.Algorithm.Design.Manual.Springer-Verlag.1998 The.Algorithm.Design.Manual.Springer-Verlag.1998

18.04.2013 Views

Lecture 10 - tree restructuring 2. No case is covered twice. In the case analysis for red-black trees, the breakdown is: Case 1: The double black node x has a red brother. Case 2: x has a black brother and two black nephews. Case 3: x has a black brother, and its left nephew is red and its right nephew is black. Case 4: x has a black brother, and its right nephew is red (left nephew can be any color). Listen To Part 10-14 Conclusion Red-Black trees let us implement all dictionary operations in . Further, in no case are more than 3 rotations done to rebalance. Certain very advanced data structures have data stored at nodes which requires a lot of work to adjust after a rotation -- red-black trees ensure it won't happen often. Example: Each node represents the endpoint of a line, and is augmented with a list of segments in its subtree which it intersects. We will not study such complicated structures, however. Next: Lecture 11 - backtracking Up: No Title Previous: Lecture 9 - catch Algorithms Mon Jun 2 09:21:39 EDT 1997 file:///E|/LEC/LECTUR16/NODE10.HTM (9 of 9) [19/1/2003 1:34:51]

Lecture 11 - backtracking Next: Lecture 12 - introduction Up: No Title Previous: Lecture 10 - tree Lecture 11 - backtracking Parallel Bubblesort In order for me to give back your midterms, please form a line and sort yourselves in alphabetical order, from A to Z. There is traditionally a strong correlation between the midterm grades and the number of daily problems attempted: daily: 0, sum: 134, count: 3, avg: 44.67 daily: 1, sum: 0, count: 2, avg: 0.00 daily: 2, sum: 63, count: 1, avg: 63.00 daily: 3, sum: 194, count: 3, avg: 64.67 daily: 4, sum: 335, count: 5, avg: 67.00 daily: 5, sum: 489, count: 8, avg: 61.12 daily: 6, sum: 381, count: 6, avg: 63.50 daily: 7, sum: 432, count: 6, avg: 72.00 daily: 8, sum: 217, count: 3, avg: 72.33 daily: 9, sum: 293, count: 4, avg: 73.25 Listen To Part 11-2 Combinatorial Search We have seen how clever algorithms can reduce sorting from to . However, the stakes are even higher for combinatorially explosive problems: The Traveling Salesman Problem Given a weighted graph, find the shortest cycle which visits each vertex once. file:///E|/LEC/LECTUR16/NODE11.HTM (1 of 8) [19/1/2003 1:34:54]

Lecture 11 - backtracking<br />

Next: Lecture 12 - introduction Up: No Title Previous: Lecture 10 - tree<br />

Lecture 11 - backtracking<br />

Parallel Bubblesort<br />

In order for me to give back your midterms, please form a line and sort yourselves in alphabetical order, from A to Z.<br />

<strong>The</strong>re is traditionally a strong correlation between the midterm grades and the number of daily problems attempted:<br />

daily: 0, sum: 134, count: 3, avg: 44.67<br />

daily: 1, sum: 0, count: 2, avg: 0.00<br />

daily: 2, sum: 63, count: 1, avg: 63.00<br />

daily: 3, sum: 194, count: 3, avg: 64.67<br />

daily: 4, sum: 335, count: 5, avg: 67.00<br />

daily: 5, sum: 489, count: 8, avg: 61.12<br />

daily: 6, sum: 381, count: 6, avg: 63.50<br />

daily: 7, sum: 432, count: 6, avg: 72.00<br />

daily: 8, sum: 217, count: 3, avg: 72.33<br />

daily: 9, sum: 293, count: 4, avg: 73.25<br />

Listen To Part 11-2<br />

Combinatorial Search<br />

We have seen how clever algorithms can reduce sorting from to . However, the stakes are even higher for<br />

combinatorially explosive problems:<br />

<strong>The</strong> Traveling Salesman Problem<br />

Given a weighted graph, find the shortest cycle which visits each vertex once.<br />

file:///E|/LEC/LECTUR16/NODE11.HTM (1 of 8) [19/1/2003 1:34:54]

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!