Introduction to Algorithm Basics

Algorithm, as the name suggests, refers to the method of computation. Algorithms are typically used to solve specific computational tasks. Unlike programs that can be directly executed on a computer, algorithms are described in a mathematical manner, focusing more on the underlying ideas, and can be seen as abstract programs. The same algorithm can be implemented in many different ways, and two different programs may also use the same algorithm.

This chapter introduces some fundamental algorithms. When a computational task is sufficiently general and widely appears in various problems, the algorithm solving that task will be invoked by more algorithms, possessing considerable importance and foundational significance. At the same time, the more general an algorithm is, the more concise it tends to be, resembling an idea rather than a program. The algorithms introduced in this chapter are sufficiently elegant and interesting, and they often appear in subsequent advanced topics.