0% found this document useful (0 votes)
13 views15 pages

Algorithms - Computer Science Aqa

An algorithm is a series of steps to complete a task, distinct from a computer program, requiring careful planning before coding. It can be represented using diagrams, flow charts, and pseudocode, which outlines the algorithm without specific language syntax. Key concepts include abstraction, decomposition, and constructs such as sequence, selection, and iteration, with examples of searching and sorting algorithms like bubble sort and merge sort.

Uploaded by

Rakshitha Patro
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views15 pages

Algorithms - Computer Science Aqa

An algorithm is a series of steps to complete a task, distinct from a computer program, requiring careful planning before coding. It can be represented using diagrams, flow charts, and pseudocode, which outlines the algorithm without specific language syntax. Key concepts include abstraction, decomposition, and constructs such as sequence, selection, and iteration, with examples of searching and sorting algorithms like bubble sort and merge sort.

Uploaded by

Rakshitha Patro
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 15

Algorithms

Rakshitha Patro
Algorithms
• An algorithm is a series of steps/ instructions that can
be followed to complete a task
• Its not the same thing as a computer program- before
you can write the problem you must work out the steps
needed to solve the problem
• Writing code is easy but working out exactly what the
code has to do is more difficult.
Algorithm to solve a problem
• The algorithm doesn’t need to be written in code, the
first step is draw a diagram or list the steps
• Break down the problem and then structure a solution
using standard tools – flow charts and pseudocode
• Pseudocode id the first step to actual coding as it
outlines the algorithm in programming constructs but
doesn't rely on any specific language syntax.
• At the end of every pseudocode or flow chart you must
have a “stop”.
Example of pseudocode
We use a backwards arrow
because its and assignment
and we cant use a = because
its not an equal to, the
backwards arrows shows that
one thing is assigned to the
variable/
The pseudoname, eg.
code, The 0 is
use:
assigned to thelanguage
• Non specific x
• Backwards arrow
• End all the functions
• Indentation is still used
Abstraction Decomposit
ion

Computational
Abstraction allows us to separate
the logical from the physical
E.g. a map of London underground-
thinking
Computer science is about studying the problems
and working out how to solve them
It might eb a mathematical problem like adding
we need to know what stations are the numbers 1 to 100 or it could be something
on each line we dont know the m0ore complex where you need to see how many
distance between stations people are at the underground station before it
before dangerously full
Developing algorithms using
pseudocodes
• Can just be bullet points/ be whatever you want
• Not a programming language
• Used to write an algorithms in programming style construct
 three constructs use to write algorithm(in an actual code):
• Sequence : writing steps in the order they need to happen
• Selection : IF/ THEN/ ELSE – allows us to choose between two options
• Iteration
Searching algorithms
Searching
algorithms
Sorting algorithms:
There are two types of sorts:
Bubble sort:
• Works by repeatedly going through the list comparing each pair of adjacent
elements
• If elements are in the wrong order, they are swapped
Len is the number of items in
a list

The number of passes


is always n-1
Merge sort

You might also like