What Is an Algorithm

· Category: Tech Fundamentals

Short answer

An algorithm is a step-by-step procedure for solving a problem or completing a task. In computing, algorithms manipulate data and make decisions.

How it works

Algorithms take inputs, perform operations, and produce outputs. They are measured by correctness, efficiency, and resource usage. Common categories include sorting, searching, and graph traversal.

Example

A sorting algorithm like merge divide the list into halves, sorts each half recursively, and merges them. It guarantees O(n log n) time complexity.

Why it matters

Every program relies on algorithms. Choosing the right one determines whether an application responds in milliseconds or minutes.