2.1 Algorithms Flashcards
What is an algorithm?
A sequence of step-by-step instructions to solve a problem or carry out a task. Can be represented using a flowchart or pseudocode.
What is a program?
A sequence of instructions for a computer.
What is computational thinking?
Solving problems logically, in a way that can be understood by humans and computers.
What is abstraction?
The removal of unwanted or unnecessary information from a task or problem in order to focus on the important and relevant information.
What is decomposition?
The process of breaking larger problem down into smaller tasks into smaller tasks that are easier to understand and solve.
What is sequence?
Carrying out tasks in a step-by-step series
What is iteration?
Repeating a task until a certain condition is met
What is selection?
A decision that needs to be made before the next step can be carried out.
What is a binary search?
Compares the required item to middle of the list, discards the irrelevant half of the list, repeats until the required item is found or the list has been fully checked.
Advantages and Disadvantages of binary search
+ Fast/efficient
- Only works in an ordered list
- Only works with numbers
What is a linear search?
compares each value in a list, one at a time, to a required value until a match is made.
Advantages and Disadvantages of linear search
+ Works with an unordered list
- Slower/less efficient than other searching algorithms
What is a bubble sort?
Repeatedly compares adjacent pairs of values in a list and swaps until all items are in order.
Advantages and Disadvantages of bubble sort
+ Simple algorithm and can be easily implemented on a computer
+ Doesn’t use much memory
- Doesn’t cope well with large lists
- Slower/less efficient than merge sort
What is a merge sort?
Data is repeatedly split into halves until single items remain, and is then reassembled in order.