Divide and Conquer Algorithms

Student Outcomes

Essence of Divide and Conquer

  1. Divide problem into several smaller subproblems

  2. Conquer the subproblems by solving them recursively

  3. Combine the solutions to get a solution to the subproblems

  4. Divide and Conquer algorithms are normally recursive

Binary Search

Recursive Binary Search

Merge Sort

Recursive Merge Sort

Recursive Merge Sort - Version 2

Quick Sort

Quick Sort - Algorithm

Quick Sort - Worst Case Time Performance

Quick Sort - Expected Case Time Performance

Quick Sort - Best Case Time Performance

Quick Sort - Constant Performance Time Performance

Quick Sort - Space Performance

Iterative Quick Sort

Quick Sort - Improving Time Performance

One-Way, Stackless Quicksort!

Matrix Multiplication

Divide and Conquer Example 2 - Matrix Multiplication

Simple Divide and Conquer Method

Strassen's Algorithm

Large Integer Multiplication

Large Integer Multiplication

Maximal Subarray

Example Divide and Conquer: Maximal-subarray Problem

Maximal Subarray: Example Scenario

Maximal Subarray: Brute Force Solution

Maximal Subarray: Divide and Conquer Solution

Maximal Subarray Algorithm

Performance of Divide and Conquer Solution