Skip to content
BENIBIX Learn

Algorithm

Development🧮 Algorithms & Data StructuresAlgorithm Basics

Also known as Algorithms

A set of clear steps that solves a problem. Programs are built from them.

Think of it like

Think of it like a recipe. Follow the steps in order, and you get the same cake each time.

Example

Jack's map app uses an algorithm to find the quickest way home. It checks many roads and picks the one that takes 12 minutes.

Why it matters

A better algorithm can turn a job of hours into a job of one second.

Definition

An algorithm is a set of clear steps that solves a problem. Given the same input, it always reaches an answer. Sorting a list, finding the shortest road and searching a page all use algorithms. One problem can have many algorithms, and some are much faster. A program is algorithms written in a language a computer can run.

Common mistake

Thinking an algorithm is a piece of code. It is the idea of the steps; code is one way to write it down.

Key takeaways

  1. 1
    Clear steps. No guessing about what comes next.
  2. 2
    It finishes. With an answer every time.
  3. 3
    Many per problem. Some much faster.

Compare