What Is an Algorithm?
-
Definition:
An algorithm is an unambiguous, abstract description of a method for solving a problem.-
Unambiguous: Everyone following the steps obtains the same result.
-
Abstract: Independent of machine or programming language.
-
Example: Recipe for baking bread — inputs (ingredients) → series of exact steps → output (bread). This emphasizes deterministic, clearly defined input–output behavior
Algorithm Complexity
Algorithms consume resources:
- ⏱ Time (primary measure)
- 💾 Memory
- 💽 I/O or storage access
- 🌐 Network use, parallelism, power, etc.
We normally analyze time complexity.
In the form of worst case and best case
#TODO