Divide and Conquer
Divide and Conquer Strategy Divide and Conquer is a problem-solving strategy in which a large and complex problem is divided into smaller problems , each smaller problem is solved separately, and then the solutions are combined to obtain the solution to the original problem. Simple idea “Break a big problem into smaller problems, solve them, and combine the answers.” This strategy is especially important in algorithm design because many difficult problems become easier when we work with smaller pieces. The Three Steps Divide and Conquer generally has three stages : 1. Divide Break the original problem into smaller sub-problems . The smaller problems should be easier to handle and usually have the same nature as the original problem . Example: Suppose we have 1,000 books to organize. Instead of organizing all 1,000 books together: 1000 Books ↓ ┌───┼────┐ ↓ ↓ ↓ Fiction Non-fiction Reference We have divided one large problem into smaller problems. 2. Conquer Solve each...