Algorithms

The Foundation of How Problems are Solved

Algorithms are a very important part of programming and development. An algorithm is essentially a step-by-step plan for solving a problem. It helps programmers think logically about what needs to be done before writing any code. This ensures that the program works correctly and efficiently.

In short, algorithms are the logic, and programming is the implementation of that logic.


Algorithms to Know

Here are some common algorithms that every programmer should be familiar with. If the algorithm name is a hyperlink, then there is a page with a description of the algorithm (possibly with a basic code implementation example).

Note that some of the algorithms may be in multiple categories since they can be used for different purposes, or they may use multiple techniques to solve a problem.

Search

Used to find specific data within a collection of data.

Sort

Used to arrange data in a specific order (e.g., ascending or descending).

Recursion

A technique where a function calls itself to solve smaller instances of the same problem.

Randomization and Shuffle

Algorithms that use random numbers to solve problems or shuffle data.

Divide and Conquer

A strategy that breaks a problem into smaller subproblems, solves each subproblem, and combines the results.

Basic Number and String

Fundamental algorithms for manipulating numbers and strings.

Graph and Tree

Used to traverse or find paths in data structures like graphs and trees.

Dynamic Programming

A method for solving complex problems by breaking them down into simpler overlapping subproblems.

Greedy Algorithms

Algorithms that make the locally optimal choice at each stage with the hope of finding a global optimum.

Hashing

A technique used to map data of arbitrary size to fixed-size values (hashes) for efficient data retrieval.