Download presentation
Presentation is loading. Please wait.
Published byPiers Nichols Modified over 9 years ago
1
Intro to Computer Algorithms Lecture 11 Phillip G. Bradford Computer Science University of Alabama
2
Announcements Advisory Board’s Industrial Talk Series http://www.cs.ua.edu/9IndustrialSeries.shtm Coop Interview Days: Oct 14th and 15th Signup begins on 22 nd of September At least 40 firms looking for coop students!
3
Outline Go over HW 4 More Divide-and-Conquer & Analysis Exam Review
4
First Midterm Exam I expect a good deal of preparation by my class Thursday 9-October Closed Book & Closed Notes Start with your home works Text book Notes
5
The week of 6-Oct I will be in Taiwan and Hong Kong doing research Prof. Borie will give Lectures in my absence!
6
Back to the Closest Pair Problem N points, then (N choose 2) pairs Compute the distance between each possible pair and Find the minimum of this list of O(N 2 ) distances Total cost: O(N 2 ) Can we do better?
7
The Closest Pair Problem How about divide-and-conquer on the x-coordinate? Then the y-coordinate? What’s wrong with this? Splitting the set gives a large cost for re- merging Sort by x-coordinate and recursively by y-coordinate
8
The Closest Pair Problem d1d1 d2d2 d d
9
The 6 points principle P d d d d
10
The Closest Pair Problem Cost? O(N log N) per dimension T(N) = 2T(N/2) + cN Master Theorem: T(N) = O(N log N).
11
Exam Review Solving Recurrences Unwinding: Formality expected by induction Master Theorem: give a, b and d. Designing & Analyzing Exhaustive Sear or Brute Force Algorithms Designing & Analyzing Divide and Conquer Algorithms
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.