What is an algorithm?
Options
- A step-by-step procedure for solving a problem (Correct option)
- A programming language used to write programs
- A type of database used to store records
- A kind of computer chip used in servers
Answer
A step-by-step procedure for solving a problem or doing a task
Why
An algorithm is a clear list of steps that always leads to a result. A cooking recipe is a good picture.
Example: 'find the largest number in a list' = look at each number and remember the biggest seen so far.
The same problem can have several algorithms; some are much faster than others, which is why we study complexity (Big-O).
Remember
Algorithm = a recipe for solving a problem.