← Back

Algorithm

What is an Algorithm?

An algorithm is a step-by-step procedure or set of instructions designed to solve a problem or accomplish a task in a finite number of steps. It’s written in clear, simple language so humans can understand the logic before coding it.


Characteristics of a Good Algorithm

An algorithm should have these properties:


Advantages of Algorithms

Algorithms help in problem solving because:


Disadvantages of Algorithms

While useful, algorithms have some downsides:


🧠 Typical Example — Algorithm to Add Two Numbers

Here’s a simple algorithm example (common in O Level notes):

  1. Start

  2. Input two numbers A and B

  3. Compute Sum ← A + B

  4. Print Sum

  5. Stop