Algorithm Analysis and Design
Algorithm Analysis and Design
CONQUER ALGORITHM
SUB-TOPIC BINARY SEARCH, MERGE SORT, QUICK SORT, STRASSEN'S
MATRIX, FINDING MAXIMUM AND MINIMUM
THE DEFECT COIN PROBLEM
DIVIDE AND CONQUER
• General Definition:
• A divide and conquer algorithm is a strategy for solving large problems by,
• 1. Breaking the problem into smaller sub-problems
• 2. Solving the sub-problems and
• 3. combining them to get the desired output
• To use the divide and conquer algorithm, recursion is used.
DAC ALGORITHM
BINARY SEARCH ALGORITHM
5 7 9 13 32 33 44 54 56 88
MERGE SORT
MERGE SORT PROCEDURE
• Median of three- In this method we consider the first, middle and last
element of the array. (2+8+4)/3 = 4.6