Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
February 19, 2022 03:05 pm GMT

7 Types of Algorithms

Brute Force
Recursive
Divide & Conquer
Greedy
Dynamic
Backtracking
Randomised

Brute Force Algorithm

It is the most common type of algorithm. Every problem can be solved by brute force approach although generally not most effective.

To design an optimal solution, we need to get a solution first at least and then it may be optimised.

Recursive Algorithm

The problem is divided into subproblems and, the subproblems are into further subproblems.

Recursion simply means calling itself to solve its subproblems.

Example: Factorial(n) = n * Factorial(n-1)

Divide & Conquer Algorithm

It divides the problems into subproblems and then solve each of them.

Then it combines the results to form the solution of the given problems.

Example: Quick Sort, Merge Sort etc.

Greedy Algorithm

In this algorithm, a decision is made that is good at that point without considering the future.

It means some local best is chosen and is considered as the global optimal.

Example: Prim's Algorithm, Job Scheduling Algorithm etc.

Dynamic Algorithm

It remembers the past results and apply it to the future corresponding results.

There are 2 approaches to solve
Bottom-Up Approach
Top-Down Approach

Example: Longest Common Subsequence etc.

Backtracking Algorithm

It starts with one possible option out of many available and try to solve the problem.

If it can't solve the problem, it will backtrack and select some other and try to solve it.

It is a form of recursion.

Example: N-Queens Problem etc.

Randomised Algorithm

In this type of algorithm, decision is taken based on the basis of random numbers.

Probability plays the most significant role in this algorithm.

Example: Randomised Quick Sort etc.

As you could see, this is just an introductory to algorithm types. Do you find these information useful?

Do you see any scope of improvement in the presentation?

Your feedbacks matter a lot.


Original Link: https://dev.to/santan21/7-types-of-algorithms-1flg

Share this article:    Share on Facebook
View Full Article

Dev To

An online community for sharing and discovering great ideas, having debates, and making friends

More About this Source Visit Dev To