Skip to content
Know.itKnow.it
Create an animated lesson
On request

This article is free to read. Creating a lesson uses your daily or stored credits; review the language and settings before starting.

What is an algorithm?

TechnologyLesson on requestFree to read

Quick answer

An algorithm is a clear, step-by-step set of instructions for solving a problem or completing a task. A recipe is an algorithm for cooking; computers run algorithms to sort lists, find routes, recommend videos, and almost everything else they do.

Key things to understand

  1. A precise step-by-step recipe to solve a problem.
  2. It takes an input and produces an output.
  3. The same algorithm works on any matching input.
  4. Better algorithms solve problems faster or with less memory.

People also ask

What is an algorithm in simple terms?
A set of clear, ordered steps that turns an input into a desired result — like a recipe a computer can follow exactly.
Where are algorithms used?
Everywhere computing happens — search engines, maps, social feeds, payments, and AI all run on algorithms.
What makes a good algorithm?
It's correct and efficient — using as little time and memory as possible to get the right answer.
Is an algorithm the same as code?
No. An algorithm is the idea or recipe; code is one way to express it in a particular programming language.
What makes an algorithm good?
Correctness (it always gives the right result) and efficiency (it uses little time and memory).
What is Big O notation?
A way to describe how an algorithm's time or memory grows as the input gets larger.