Site icon TestingDocs.com

Types of Algorithms

Overview

In this tutorial, we will learn about different types of algorithms and classify them based on problem-solving techniques.

Types of Algorithms

Some types of algorithms are as follows:

Brute force algorithm

A brute force algorithm tries all the possibilities until a satisfactory solution is found.

Recursive algorithm

A recursive algorithm is an algorithm that calls itself in its own steps. A recursive algorithm does the following:

Divide & Conquer algorithm

A divide & conquer algorithm consists of two parts:

Backtracking algorithm

The backtracking algorithm explores all possible choices or decisions one at a time and then “backtracks” from a choice that does not lead to a valid solution.

Dynamic programming algorithm

A dynamic programming algorithm uses memoization. It remembers past results and uses them to find new results. Dynamic programming algorithms are generally used for optimization problems.

Greedy algorithm

A greedy algorithm works in phases. At each phase:

Randomized algorithm

A randomized algorithm uses a random number at least once during the computation to make a decision.

Exit mobile version