Introduction to Basic Algorithms
An algorithm is a method of computation. It usually solves one specific computational task. Unlike a program, which runs directly on a computer, an algorithm is described in mathematical terms and is concerned more with the idea: think of it as an abstract program. One algorithm can be implemented in many different ways, and two different programs may use the same algorithm.
This chapter introduces some basic algorithms. When a computational task is general enough to come up in all kinds of problems, the algorithm that solves it gets called by many other algorithms, which makes it both important and fundamental. The more general an algorithm is, the simpler it tends to be, and the closer it is to an idea than to a program. The algorithms in this chapter are elegant and fun, and they turn up again and again in the more advanced material that follows.
This page is an unofficial English translation of the original OI Wiki page (revision 5a3c3d0d), machine-translated by Claude Fable 5.2 on 2026-11-16. It has been modified from the original by translation and may contain errors. It is not endorsed by OI Wiki.
Found a translation problem? Report it on GitHub.
Authors of the original page: Ir1d, HeRaNO, 24OI-bot, Chrogeek, ouuan, NachtgeistW, Marcythm, Tiphereth-A (full contribution history)
All content on this page is provided under the terms of CC BY-SA 4.0 and SATA; additional terms may apply.