Please enable JavaScript.
Coggle requires JavaScript to display documents.
Brute Force, Decrease and conquer - Coggle Diagram
Brute Force
Examples of brute force
Bubble sort
Compare adjacent elements of the list and echange them if needed
Has a lot of phases, but have really diferents best and worst cases
Selection sort
Scans the entire list and replaces each element in accord of what is needed
Straightforward solving method
Even if rarely the most efficient, has very wide aplication
Decrease and conquer
Major variations
Decrease by a constant factor
Reducing a problem instance by the same constant each interetion
Variable size decrease
size reduction pattern varies from each iteration
Decrease by a constant
Size of instance is reduced equally on each iteration
Best general algorithm design technique
The problem is divided in less complex subproblems
Solutions of the subproblems can be combined to get the solution
Example of algorithm
Mergesort
Sorts an array in two halves and sort them recursively
Shines in parallel computations, when subproblems can be executed simultaneosly