2. A sequence of instructions
A precise step-by-step procedure
The first step to writing the program
(i.e. the idea in your head)
3. Often, algorithms should not just work, but
should also run efficiently
Time taken for execution
Memory used for execution
Big-O Notation
A measure of increase in computation for an
increase in input
Different from the Little-O Notation
4. Example: Search an array of ‘n’ elements for a
value
Compare each element
O(N) algorithm
Example: Set the first element of an array of
‘n’ elements to zero
Set array[0] = 0 //sets the 1st element to 0
O(1) algorithm