Skip to main content

Banner image missing or invalid: banners/note-banner.png

Algorithm

Banner image missing or invalid: banners/note-banner.png

Author: Rino , Created on Apr 15, 2025 2 min read

Outlines a precise, finite set of steps designed to solve a problem or perform a computation, serving as the fundamental building block of computer science.

Algorithm

What Exactly is an Algorithm?

Rather than a daunting technical term, an Algorithm is better understood as a clear "instruction manual" or a "recipe." It is essentially a sequence of precisely defined, finite steps designed to solve a particular class of problems or perform a computation. In a sense, algorithms are the soul of Computer Science, serving as the bridge between "problems" and "programs."

Characteristics of a Good Algorithm

An effective algorithm typically needs to satisfy several conditions:

  1. Input: It needs to know what information it is going to process.
  2. Output: It must produce at least one final result.
  3. Definiteness: Every step's instruction must be precise and unambiguous.
  4. Finiteness: It must complete its task in a finite number of steps and come to a halt; it cannot loop indefinitely.
  5. Effectiveness: Every operation must be basic enough that it could, in principle, be done by a person with paper and pencil.

Historical Roots

The word "Algorithm" is derived from the name of the 9th-century Persian mathematician Al-Khwarizmi (c. 780 – c. 850). The first complex algorithm truly designed for a "computer," however, is credited to Ada Lovelace in the 19th century.

  • Popular Science:
    • (Book) Computer Science: A Very Short Introduction by Subrata Dasgupta.
    • (Book) Grokking Algorithms by Aditya Y. Bhargava.
  • Textbooks:
    • (Book) Introduction to Algorithms by Cormen, Leiserson, Rivest, and Stein (CLRS).