Intro to Algorithms
An algorithm is a procedure used to solve a problem or perform a computation.
While a recipe or a set of directions to Tesco is an algorithm in the broadest sense (a recipe solves the problem of cooking a dish while a set of directions to Tesco gets you there), algorithms in CS typically:
- solve any instance of a class of problems (e.g. sorting algorithms should work on any lists no matter how elements are arranged)
- including different sized problems (e.g. sorting algorithms should work for a list of size = 10, and a list of size = 5000)