Types of Algorithms

A list of algorithm approaches you can use to solve many problems.

Brute Force

Also referred to as exhaustive search because it is a naive approach that looks at all possible solutions for the problem and chooses the best solution.

Divide and Conquer

There are two components to this algorithm. The first step is to determine if you can split your current problem into smaller sub-problems and then combine smaller sub-problems to find the answer.

Decrease and Conquer

This approach is used when you only have one sub-problem, but you can filter the input by a simpler function in order to decrease the amount of complexity of the problem.

Greedy Approach

This algorithm is used to find the approximate best answer for hard problems. What it does is at a given time, it will take the locally optimal choice with the intent for finding the optimal solution.

Dynamic Programming

Another approach of splitting up a complex problem into overlapping sub-problems, using the answer for the sub-problems to answer the initial problem. This usually involves saving the answer to certain sub-problems to be used later.

Backtracking

Backtracking algorithms can be used when you are finding all answers that satisfy a certain constraint. It will build its solution as long as it satisfies the condition, and throw it out once it does not.

Comments

Popular posts from this blog

Uncle Bob's Clean Architecture

C4 Model: Describing Software Architecture

Multi-Tenant Design: The Basics