What Are Algorithms?

An algorithm is a finite, well-defined sequence of steps (instructions) to solve a particular problem or perform a computation. The steps should be deterministic or clearly specified, produce correct output for valid input, and terminate (in most practical cases).

Key properties:

  • Correctness: Produces desired result for all inputs (or well‐defined domain).

  • Finiteness: Must terminate after a finite number of steps.

  • Determinism (or clearly defined behavior): No ambiguities.

  • Efficiency & Resource Constraints: Time, memory, sometimes network / I/O.