You are on page 1of 4

Algorithms

What is an
algorithm

finite input finite output

natural numbers
esp
S
doesn't use
up to
efficient
much the or
space
net to size of input

process procedure
deterministic same input always
same output
9 yields
models a function

always produces an output


in principle can be implemented

on an idealized computer

algorithm is designed to solve a

problem and should be correct

ie always produce
correct answer

Prototypical example sorting


Problem have list of n numbers

Want to put then in order

One attempt tr all possible orderings

g
There are n f of them
Fone method
Brute
in
Long
9
divisor de 0,1
Input
dividend Lpo p Ht
pe
t tpe10
N pot pilot pz.IO

567 7 6 lots.io
e.g
remainder
Output quotient
t 19 9
lot tomtom
Q got g
Go fi gm

Correct N Qd tr

927 fo AND red


g
9 o
g Effi 42 6 I
pl rein 2 heir 6

I rni

O
14
To

You might also like