[UNFINISHED] Introduction to Algorithms
REF_DATE: 02-FEB-2026 TAGS:
Most of the following comes from lecture slides and material by Ran Wei and Andrew Sogokoń from the Lancaster University course “SCC.223 - Algorithms”
Introduction
What is an Algorithm?
- A rule for solving a mathematical problem in a finite number of steps
- A set of instructions or steps designed to provide a method of solving a problem or achieving a result (computing)
- A step-by-step method for solving a problem
- The Chambers Dictionary (TCD)
Algorithms can be thought of as providing blueprints for a program. They outline a solution, which a program then implements.
Example
A simple algorithm returning the absolute of a value:
int abs(int x) {
if (x < 0) {
return -x;
} else {
return x;
}
} Notes
Pseudocode
- Algorithms are not language-dependent
- Many are written in psuedocode to more easily convey the idea, instead of syntax
- Unlike in maths, ”=” denotes assignment, and ”==” denotes equality in most programming languages.