0% found this document useful (0 votes)
76 views

Unit 2 Divide and Conquer

The document discusses divide and conquer algorithms. It covers binary search, merge sort, quicksort, and selection sort as examples of divide and conquer algorithms. It also mentions Strassen's matrix multiplication algorithm and the convex hull problem as other examples of problems solved using the divide and conquer approach. The document was prepared by Sujan Kunwar for a computer engineering course on algorithm analysis and design.

Uploaded by

Miraj Shrestha
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
76 views

Unit 2 Divide and Conquer

The document discusses divide and conquer algorithms. It covers binary search, merge sort, quicksort, and selection sort as examples of divide and conquer algorithms. It also mentions Strassen's matrix multiplication algorithm and the convex hull problem as other examples of problems solved using the divide and conquer approach. The document was prepared by Sujan Kunwar for a computer engineering course on algorithm analysis and design.

Uploaded by

Miraj Shrestha
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 20

Algorithm Analysis & Design

2. Divide and Conquer


Introduction

2.1 General Method

Prepared by Sujan Kunwar, BE (Computer) Batch‐2010, Acme Engineering College  Page 1 
Algorithm Analysis & Design

2.2 Binary Search

Prepared by Sujan Kunwar, BE (Computer) Batch‐2010, Acme Engineering College  Page 2 
Algorithm Analysis & Design

Prepared by Sujan Kunwar, BE (Computer) Batch‐2010, Acme Engineering College  Page 3 
Algorithm Analysis & Design

Prepared by Sujan Kunwar, BE (Computer) Batch‐2010, Acme Engineering College  Page 4 
Algorithm Analysis & Design

Prepared by Sujan Kunwar, BE (Computer) Batch‐2010, Acme Engineering College  Page 5 
Algorithm Analysis & Design

2.3 Merge Sort

Prepared by Sujan Kunwar, BE (Computer) Batch‐2010, Acme Engineering College  Page 6 
Algorithm Analysis & Design

Prepared by Sujan Kunwar, BE (Computer) Batch‐2010, Acme Engineering College  Page 7 
Algorithm Analysis & Design

Prepared by Sujan Kunwar, BE (Computer) Batch‐2010, Acme Engineering College  Page 8 
Algorithm Analysis & Design

Quick Sort

Prepared by Sujan Kunwar, BE (Computer) Batch‐2010, Acme Engineering College  Page 9 
Algorithm Analysis & Design

Prepared by Sujan Kunwar, BE (Computer) Batch‐2010, Acme Engineering College  Page 10 
Algorithm Analysis & Design

Prepared by Sujan Kunwar, BE (Computer) Batch‐2010, Acme Engineering College  Page 11 
Algorithm Analysis & Design

Selection Sort

Prepared by Sujan Kunwar, BE (Computer) Batch‐2010, Acme Engineering College  Page 12 
Algorithm Analysis & Design

Prepared by Sujan Kunwar, BE (Computer) Batch‐2010, Acme Engineering College  Page 13 
Algorithm Analysis & Design

Prepared by Sujan Kunwar, BE (Computer) Batch‐2010, Acme Engineering College  Page 14 
Algorithm Analysis & Design

Prepared by Sujan Kunwar, BE (Computer) Batch‐2010, Acme Engineering College  Page 15 
Algorithm Analysis & Design

Prepared by Sujan Kunwar, BE (Computer) Batch‐2010, Acme Engineering College  Page 16 
Algorithm Analysis & Design

2.4 Strassen’s Matrix Multiplication


The Strassen’s method of matrix multiplication is a typical divide and conquer algorithm. We’ve seen so far some
divide and conquer algorithms like merge sort and the Karatsuba’s fast multiplication of large numbers. However let’s
get again on what’s behind the divide and conquer approach.

Prepared by Sujan Kunwar, BE (Computer) Batch‐2010, Acme Engineering College  Page 17 
Algorithm Analysis & Design

Prepared by Sujan Kunwar, BE (Computer) Batch‐2010, Acme Engineering College  Page 18 
Algorithm Analysis & Design

The convex hull of a set P of points (or other objects!) is the smallest convex set containing P.

Prepared by Sujan Kunwar, BE (Computer) Batch‐2010, Acme Engineering College  Page 19 
Algorithm Analysis & Design

Prepared by Sujan Kunwar, BE (Computer) Batch‐2010, Acme Engineering College  Page 20 

You might also like