0% found this document useful (0 votes)
2 views3 pages

Algorithm Types

The document outlines various algorithm types including Brute Force, Divide and Conquer, Greedy, Dynamic Programming, Backtracking, Recursive, and Randomized Algorithms. Each algorithm is described in terms of its working mechanism, best use cases, and examples. The content serves as a guide for understanding different approaches to problem-solving in computer science.

Uploaded by

m.gitaram.20
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views3 pages

Algorithm Types

The document outlines various algorithm types including Brute Force, Divide and Conquer, Greedy, Dynamic Programming, Backtracking, Recursive, and Randomized Algorithms. Each algorithm is described in terms of its working mechanism, best use cases, and examples. The content serves as a guide for understanding different approaches to problem-solving in computer science.

Uploaded by

m.gitaram.20
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Brute Force Algorithms

How it works: The most straightforward approach. It tries every possible option to find a solution,
without optimizing for speed.

Best used for: Simple tasks or finding any baseline solution before optimization.

Example: Sequential/linear search (checking a list one by one until the target is found).

Medium

·Vinod Borole

+1

2. Divide and Conquer Algorithms

How it works: Breaks a problem into smaller, independent sub-problems, solves each sub-problem
recursively, and then combines the results.

Best used for: Sorting data or performing efficient searches.

Example: Binary Search or Merge Sort.

GeeksforGeeks

+4

3. Greedy Algorithms

How it works: Makes the choice that looks the best at the exact current moment, hoping this "local"
best will eventually lead to the "global" best.

Best used for: Optimization and pathfinding problems.

Example: Dijkstra's Algorithm for finding the shortest path on a map.

GeeksforGeeks

+4

4. Dynamic Programming (DP)


How it works: Breaks a complex problem into overlapping sub-problems, solves them, and stores
(memoizes) the results so you never have to calculate the same thing twice.

Best used for: Maximizing efficiency when similar calculations are repeated.

Example: The Fibonacci sequence or the Knapsack problem.

GeeksforGeeks

+1

5. Backtracking Algorithms

How it works: Builds a solution step-by-step. If at any point it realizes that the path won't lead to a valid
solution, it abandons it and "backtracks" to try a different path.

Best used for: Puzzles, maze-solving, and combinatorial problems.

Example: Solving a Sudoku puzzle or the N-Queens problem.

YouTube

·TimesPro

+4

6. Recursive Algorithms

How it works: Solves a problem by calling a simpler version of itself over and over again until it reaches a
baseline "base case".

Best used for: Tree and graph traversals.

Example: Factorials (e.g., n! = n × (n-1)!).

Medium

·Vinod Borole

+4

7. Randomized Algorithms
How it works: Uses a random number generator to determine the next step or input during the decision-
making process.

Best used for: Complex problems where finding an exact deterministic solution takes too long.

Example: Randomized Quick Sort or Monte Carlo methods.

Indian Institute of Science

+4

You might also like