Skip to main content

Introduction to Algorithms

The word Algorithm means ”A set of finite rules or instructions to be followed in calculations or other problem-solving operations” Or ”A procedure for solving a mathematical problem in a finite number of steps that frequently involves recursive operations”.

There are many important algorithms that are commonly covered in technical interviews. Here is a list of some common algorithms that you might be expected to know:

  1. Sorting algorithms: algorithms for sorting a list of items, such as bubble sort, insertion sort, merge sort, and quick sort.
  2. Search algorithms: algorithms for searching a list of items, such as linear search, binary search, and ternary search.
  3. Graph algorithms: algorithms for working with graphs, such as Depth-First Search (DFS), Breadth-First Search (BFS), and shortest path algorithms (e.g., Dijkstra's algorithm and A*).
  4. Tree algorithms: algorithms for working with trees, such as tree traversal algorithms and algorithms for maintaining binary search trees.
  5. Dynamic programming: algorithms for solving problems by breaking them down into smaller subproblems and storing the results to avoid unnecessary recomputation.
  6. Divide and conquer: algorithms for solving problems by dividing them into smaller subproblems and solving each subproblem separately.
  7. Greedy algorithms: algorithms for making locally optimal choices at each step in order to try to achieve a global optimal solution.
  8. String matching algorithms: algorithms for finding patterns in strings, such as the Knuth-Morris-Pratt (KMP) algorithm and the Boyer-Moore algorithm.
  9. Hashing algorithms: algorithms for mapping keys to indices in a hash table, such as linear probing and separate chaining.
  10. NP-hard problems: understanding of the concept of NP-hard problems and techniques for solving them, such as approximation algorithms and heuristics.

It's also helpful to be familiar with various data structures, such as arrays, linked lists, stacks, queues, and heaps, and how to use them to implement algorithms efficiently.

Types of Algorithms

  1. Brute Force Algorithm
  2. Recursive Algorithm
  3. Backtracking Algorithm
  4. Searching Algorithm
  5. Sorting Algorithm
  6. Hashing Algorithm
  7. Divide and Conquer Algorithm
  8. Greedy Algorithm
  9. Dynamic Programming Algorithm
  10. Randomized Algorithm

Algorithm complexity

  1. Space Complexity
  2. Time Complexity