• # Revision:Algorithms

An algorithm is defined as a finite sequence of unambiguous instructions for solving a problem.

• Every algorithm requires an input
• The output depends only on the input
• The algorithm must terminate in a finite time for all inputs (it doesn't get stuck in a loop)

## Order

The order of an algorithm is a measure of the approximate run time for an algorithm, depending on the size of the problem. For large problems we only need to consider the dominant term to get an approximate run time.

The efficiency of an algorithm is a measure of how well an algorithm copes with an increase in the size, n, of a problem. The efficiency decreases as run time increases.

Order Run time proportional to
Linear
Cubic
Exponential or

### Example

A computer takes 2 seconds to solve a problem of size 30. Estimate the times taken to solve a problem of size 300 if the algorithm used has

• an order n

• an order n2

• an order n3

• an order 2n

Therefore, using n = 300

## Also See

See the other D1 notes:

Try Learn together, TSR's study area

35,166
revision notes

38,547
mindmaps

38,610
crosswords

15,066
quizzes

create
a study planner

thousands
of discussions

Today on TSR

### How does exam reform affect you?

From GCSE to A level, it's all changing

### Q&A with Paralympian Jack Rutter

Poll
Study resources

The Student Room, Get Revising and Marked by Teachers are trading names of The Student Room Group Ltd.

Register Number: 04666380 (England and Wales), VAT No. 806 8067 22 Registered Office: International House, Queens Road, Brighton, BN1 3XE