SAM HARRIS TECH REVISION
OCR GCSE CS - 2.1 Algorithms (Deep Dive)
2.1 Algorithms (OCR J277)
2.1.1 Computational Thinking Concepts
- Abstraction: Removing unnecessary details (e.g., in a map, removing trees and house colours to focus on road connections).
- Decomposition: Breaking a large task (like making a game) into smaller modules (player movement, graphics, scoring).
- Algorithmic Thinking: Creating a logical, step-by-step process to solve a problem that can be repeated by anyone or any computer.
2.1.2 Designing and Refining
- Standard Flowchart Symbols:
- Oval: Terminator (Start/Stop)
- Rectangle: Process (Calculation or assignment)
- Diamond: Decision (Yes/No questions)
- Parallelogram: Input/Output
- Trace Tables: Used to record the value of each variable, the output, and the condition of any decision steps as an algorithm runs. Essential for spotting zero errors.
- Refining: The process of making an algorithm more efficient or robust (e.g., adding input validation).
2.1.3 Searching Algorithms
- Binary Search:
- Requires the list to be sorted.
- Checks the middle item, discards the half that doesn't contain the target, and repeats. Very fast for large lists.
- Linear Search:
- Works on unsorted lists.
- Starts at the beginning and checks every item sequentially until the target is found or the end is reached.
2.1.4 Sorting Algorithms
- Bubble Sort: Steps through the list, compares adjacent items, and swaps them if they are in the wrong order. Requires multiple passes.
- Merge Sort: A "divide and conquer" algorithm. Splits the list into individual items, then merges them back together in the correct order. Very efficient but uses more memory.
- Insertion Sort: Builds the final sorted list one item at a time by taking each new item and "inserting" it into its correct position among the already-sorted items.
Related Past Paper Questions
-
Year: 2024
Explain the difference between a 'linear search' and a 'binary search'.
Mark: [3]
-
Year: 2024
Describe how a 'bubble sort' algorithm works to sort a list of numbers.
Mark: [3]
-
Year: 2023
Explain what is meant by 'abstraction' when creating a computer model.
Mark: [2]
-
Year: 2023
State the name of the process used to break a problem down into smaller, manageable sub-problems.
Mark: [1]
-
Year: 2022
Identify two advantages of using a binary search compared to a linear search.
Mark: [2]
-
Year: 2022
Describe the steps an insertion sort takes to sort the following list: [5, 2, 4, 1].
Mark: [4]
-
Year: 2021
Define the term 'algorithmic thinking'.
Mark: [2]
-
Year: 2021
A list of names is: [Zane, Alice, Bob, Xavier]. Explain why a binary search cannot be performed on this list in its current state.
Mark: [1]
-
Year: 2020
Explain the process of a 'merge sort' algorithm.
Mark: [4]
-
Year: Sample Paper
State the purpose of a 'pseudocode' when designing an algorithm.
Mark: [2]