Download presentation
Presentation is loading. Please wait.
Published byAubrey Waters Modified over 9 years ago
1
Divide and Conquer
2
Divide and Conquer is a technique for designing the algorithms that consists of decomposing the instance to be solved into a number of smaller subinstance of the same problem, solving successively and independently each of these subinstances, and then combining the subsolutions thus obtained to obtain the solution of the original instance.
3
Divide and Conquer (typical case)
4
Recursion Most of the algorithms are recursive in nature. Recursive algorithm follows Divide and Conquer approach.
5
3 Steps of Divide and Conquer Divide: In this step whole problem is divided into number of several sub problems. Conquer: The sub problems by solving them recursively. If the sub problem sizes are small enough, however, just solve the sub problems in a straight forward manner. Combine: Finally, the solutions obtained by the sub problems are combined to create solution to the original problem.
6
Control Abstraction Control abstraction mirrors the way an algorithm based on divide and conquer will look. By a Control abstraction we mean a procedure whose flow of control is clear but whose primary operations are specified by other procedures whose precise meanings are left undefined.
Similar presentations
© 2024 SlidePlayer.com Inc.
All rights reserved.