What is algorithm? Types of algorithm

In today’s world, your digital life is highly influenced by algorithms. Whatever you see on social media sites like Instagram and youtube is decided by their algorithm.

The algorithm is a pre-defined step that needs to be followed to get a predetermined result. Depending on what you do with the algorithm, the algorithm can be simple or complicated.

Type of algorithm

Sorting Algorithm

The sorting algorithms arrange data in a defined way for further use. It is very helpful when you have a lot of data. And manually arrange of that is not possible.

Generally, the Sorting algorithm arranges data either in ascending order or in descending order.

Divide and Conquer Algorithm

The divide and Conquer algorithm divides the problem into small pieces and solves that piece’s problem one by one. And combine all solutions to get the final results.

This Algorithm work in three steps i.e. Divide, Solve and Combine.

Backtracking Algorithm

The backtracking algorithm finds the solution by searching for all possible available solutions.

In this algorithm, when a solution fails it comes back to the failure point and from their try to find the next solution. And it continues until it finds the solution or all possible solutions that can work.

Greedy Algorithm

A greedy algorithm creates solution piece by piece by selecting the next piece that offers the most understandable and immediate benefit. This algorithm is easy to understand and apply.

This algorithm ignores that the current best solution may not bring the overall best result. The main issue of the greedy algorithms is related to analyzing the accuracy.

Dynamic Programming Algorithm

Dynamic Programming algorithm divides the problem into small pieces of the problem. And then save all possible solutions of small pieces. And then optimize all save solutions to find the overall solution.

Dynamic programming can be achieved only using two approaches i.e. Top-down approach and the Bottom-up approach.

Brute Force Algorithm

The brute force algorithm tries every possible solution for a given problem and provides the first possible solution as an optimal result.

The time taken by this algorithm to complete a task completely depends on system hardware performance. this algorithm is of two types i.e. Optimised and Satisfied.

Advantage of algorithm

Easy to understand: An algorithm is a step-by-step procedure to provide a solution for a problem. Thus it became easy to read and understand.

Easy convert it into actual program: breaking down the problem into small pieces. And solving subproblem step by step, make it easy to convert the algorithm into the actual problem.

Procedure is predefined: The algorithm has its own predefine ways to find solutions.

Debugging is easy: Every step involved in the algorithm has its logic, It makes debugging the algorithm easy.

No need for a programming language: There is no need for knowledge of any programming language to create an algorithm.

Disadvantage of algorithm

Time-consuming: Creating the algorithm takes a lot of time even for small problems. For a simple solution, It takes more time than normally required to solve a problem.

Not for complex problem: An algorithm is not recommended for solving a complex problem. As the algorithm is not capable to understand the complex problem.

Require lots of data: The algorithm finds a solution for a given problem from available data. So algorithms require a lot of data to find the optimized results.

No big task: An algorithm is not suitable for big tasks.

Consume lot of memory: An algorithm consume a lot of memory for its functioning.