adam barnhard

Introduction to Algorithms - CH 01


Informally, an algorithm is any well defined computational procedure that takes some value, or set of values, as input and
produces some value, or set of values, as output. An algorithm is thus a sequence of computational steps that transform the
input into the output
Cormen Leiserson Rivest Stein, 2004, p# 5

Algorithms are any well defined procedure that transforms one thing into another, and are not limited to the domain of computer science. The process by which you brew beer is technically an algorithm as it is composed of a set of well defined steps to transform one thing into another.

An algorithm is said to be correct if it halts with the correct output for a given input. An incorrect algorithm will return the wrong output, or not return anything at all.

The usual measure of an algorithm’s efficiency is speed, or how long it takes to transform its inputs to outputs.

Algorithm choice can have as much or more effect on the runtime on an application as the choice of hardware or language the application is written in.


Share this: