Computer algorithm

Level 2 Category

Definition

A step-by-step procedure or set of rules for solving a problem or performing a computation. Algorithms are often represented visually with flowcharts, pseudocode, or state diagrams to clarify logic.

Example Image

GCD through successive subtractions. SVG file, available at https://commons.wikimedia.org/wiki/File:GCD_through_successive_subtractions.svg. Licensed under CC BY-SA 4.0.

Writing Alternative Text

Describe the purpose of the algorithm, its inputs and outputs, and the sequence of operations or decision points used to achieve the result. Explain how control flows through the algorithm, including any branches, loops, repetitions, state transitions, or termination conditions. When relevant, mention relationships between components, such as the direction of processing, data flow, or connections between steps. Include visual elements, symbols, shapes, or notation only when they are necessary to understand the algorithm's logic or meaning.

Example Alt Text

"Flowchart computes the greatest common divisor of natural numbers r and s. If s equals zero, r is stored as d. Otherwise, the loop checks r. If r equals zero, s becomes d. If r is less than s, the values are swapped using d; then s is subtracted from r. The loop repeats until either value reaches zero, and d is output as the greatest common divisor."

Navigation