1 / 28

Lecture 4 Divide-and-Conquer

Lecture 4 Divide-and-Conquer. What’s Self-Reducibility?. A problem can be reduced to several “same” problems with smaller inputs. Divide and Conquer. Divide the problem into subproblems. Conquer the subproblems by solving them recursively.

shalondaj
Download Presentation

Lecture 4 Divide-and-Conquer

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Lecture 4Divide-and-Conquer

  2. What’s Self-Reducibility? • A problem can be reduced to several “same” problems with smaller inputs.

  3. Divide and Conquer • Divide the problem into subproblems. • Conquer the subproblems by solving them recursively. • Combine the solutions to subproblems into the solution for original problem.

  4. Tree Structure problem subproblem subproblem subsubproblem subsubproblem subsubproblem subsubproblem

  5. Insertion Sort

  6. key

  7. Merge Sort

  8. Procedure divide conquer combine

  9. Heapsort 16 14 10 3 9 8 7 2 4 1

  10. Heapsort

  11. Heapsort

  12. Quicksort divide conquer combine is simplified

  13. Selection with O(n) Comparisons divide conquer divide conquer

  14. Remark on Divide and Conquer Key Point:

  15. Merge Sort Quick Sort Selection Analysis requires to solve a recurrence!

  16. Maximum Subarray

  17. Problem

  18. Closest pair of points

  19. Matrix Multiplication

  20. n/2 Step 1 n/2

  21. Step 2 Step 3

  22. Step 4

  23. Master Theorem

More Related