What is an algorithm?
A set of instructions for solving a problem or completing a task.
What is abstraction?
Ignoring or filtering out the unnecessary details in order to simplify the problem.
What is decomposition?
Breaking down a large problem into smaller sub-problems.
What is algorithmic thinking?
Identifying the steps involved in solving a problem, in other words, designing the algorithm.
What is pattern recognition?
Looking for similarities among and within problems.
What are the principles of computational thinking?
State the two standard searching algorithms
What is a searching algorithm?
These allow a set of data to be examined and for a specific item to be found
What are the main steps involved in a linear search?
What are the main steps involved in a binary search?
What is the worst case scenario for a binary search?
n + 1
Where n = number of times data set can be halved
What is the best case scenario for a binary search?
1
What is the worst case scenario for a linear search?
N
Where N is the number of items in the data set
What is the best case scenario for a linear search algorithm?
1
What are three differences between binary and linear search algorithms?
BINARY:
- data must be ordered
- worst case scenario is n + 1 (where n = number of times the list can halve itself)
- longer + more complex to write
LINEAR:
- data does not need to be ordered
- worst case scenario = N, where N = number of items in the data set
- simpler to write
What are the pre-requisites for a binary search algorithm?
The list of data must already be sorted
What are the pre-requisites for a linear search algorithm?
It does not require any pre-requisites
State the 3 standard sorting algorithms.
What is a sorting algorithm?
These allow a data set to be sorted into order
Why do computers work more efficiently with sorted lists?
This allows computers to use a binary search, which is far more efficient than a linear search.
Describe the main steps of bubble sort
Start with the leftmost item
• Compare this item with the one next to it
• If the one next to it is less, swap the items
• Repeat for all the other items
• At the end of one pass through the list, the largest item is at the end of the list
Repeat the process until the items are sorted
What is a pass in the bubble sort algorithm?
Each run through the list, from start to finish.
Are there any pre-requisites for bubble sort?
No
Describe the main steps of insertion sort.
An insertion sort compares values in turn, starting with the second value in the list.
If this value is greater than the value to the left of it, no changes are made.
Otherwise this value is repeatedly moved left until it meets a value that is less than it.
The sort process then starts again with the next value.
This continues until the end of the list is reached.