## Booklet

# Types of Algorithms You Should Know

Types of Algorithms You Should Know

Search Algorithm

Designed to retrieve information stored within a data structure.

Examples:

Linear Search

Binary Search

Depth-First Search (DFS)

Breadth-First Search (BFS)

Sort Algorithm

This is used to re-arrange arrays or a given list of elements according to a comparison operator function. The comparison operator is used to decide the new order of elements.

Examples:

Quick Sort

Insertion Sort

Selection Sort

Bubble Sort

Merge Sort

Radix Sort

Heap Sort

Dynamic Programming

Can optimize recursion. Dynamic Programming stores the results of sub-problems for re-computation, for future use. This simple optimization reduces time complexities from exponential to polynomial time.

Examples:

Fibonacci Number Series

Knapsack Problem

Tower of Hanoi

Shortest Path by Dijkstra

Matrix Chain Multiplication

Recursive Algorithm

An algorithm which calls itself with smaller or simpler input values. The result is returned back up the chain of calls until it hits the original problem.

Examples:

Factorial

Exponential

Tower of Hanoi

Tree Traversals

Depth-First Search

Greedy Algorithm

An algorithmic paradigm that builds up a solution piece by piece, always choosing the next piece that offers the most obvious and immediate benefit.

Examples:

Huffman Coding

Fractional Knapsack Problem

Activity Selection

Job Sequencing Problem

In summary...

Search Algorithm

Sort Algorithm

Dynamic Programming

Recursive Algorithm

Greedy Algorithm

Join our tech and design community! @hackuniversity