### Representing Algorithms

Click to see the rest of the Algorithms section :

An algorithm can be described as “A set of steps that show how to perform a task or reach a goal”. When we talk about algorithms in Computer Science, this generally means the design of a program – not every task can be solved using computational methods as some tasks involve non-mathematical tasks (known as ‘messy problems’) that generally relate to unpredictable human behavior.

We usually design our algorithms in either a flowchart or as pseudocode. In either way, our algorithms should be focused o the logic of the task which means that we should be able to implement them using any programming language. This is known as being ‘language independent’.

There are a number of ‘standard algorithms’ that we are expected to know when studying computer science. These are algorithms that make up a lot of what we do when designing programs and include patterns that can be reused in other solutions.

The ‘standard algorithms’ we are expected to know and recognise at GCSE are specific to Sorting & Searching. (See Searching Algorithms & Sorting Algorithms).

In your exam, it is likely that you will be shown or asked to write algorithms using pseudocode. There are some basic syntax rules that will make it easier for you to do this:

Instead of = use <–    For example, instead of x = 5 you would write x <– 5

Loops have a start and an end:

```WHILE x < 5 DO

OUTPUT x

END WHILE

```

Write your key words in CAPITALS – you won’t actually lose marks for not doing so, but it makes your pseudocode clearer, and the clearer that it is, the easier it is to mark!