This topic covers the fundamental algorithms used in computer science, focusing on graph and tree traversal, searching, sorting, and optimization. It also
Topic Synopsis
This topic covers the fundamental algorithms used in computer science, focusing on graph and tree traversal, searching, sorting, and optimization. It also explores the theoretical aspects of algorithmic complexity, including Big-O notation and the classification of problems as tractable or intractable.
Key Concepts & Core Principles
- Algorithmic thinking: The ability to break down problems into clear, logical steps and represent them as algorithms using pseudocode or flowcharts.
- Searching algorithms: Linear search (O(n)) and binary search (O(log n)) – understand their steps, efficiency, and when to use each (binary search requires sorted data).
- Sorting algorithms: Bubble sort (O(n^2)), merge sort (O(n log n)), and insertion sort (O(n^2)) – know how they work, their best/worst-case complexities, and stability.
- Big O notation: A way to describe the time and space complexity of an algorithm, focusing on the worst-case scenario. For example, O(1) is constant time, O(n) is linear, O(n^2) is quadratic.
- Trace tables: A method to manually execute an algorithm step by step, recording variable values to verify correctness or find errors.
Exam Tips & Revision Strategies
- Practice tracing algorithms manually on paper to ensure accuracy
- Memorize the time complexity classes (O(1), O(log n), O(n), O(n log n), O(n^2), O(2^n))
- Use clear, step-by-step notation when converting to RPN
- Ensure you can explain the 'Divide and Conquer' approach used in merge sort
- Be prepared to explain the significance of the Halting problem as a limit of computation
Common Misconceptions & Mistakes to Avoid
- Confusing the order of traversal in tree algorithms (e.g., pre-order vs post-order)
- Incorrectly calculating time complexity for algorithms
- Failing to correctly convert infix expressions to RPN
- Misunderstanding the difference between tractable and intractable problems
- Inability to correctly trace Dijkstra's algorithm steps
Examiner Marking Points
- Ability to trace breadth-first and depth-first search algorithms
- Ability to trace pre-order, post-order, and in-order tree-traversal algorithms
- Ability to convert between infix and Reverse Polish notation
- Knowledge of time complexity for linear search, binary search, and binary tree search
- Knowledge of time complexity for bubble sort and merge sort
- Ability to trace Dijkstra’s shortest path algorithm
- Understanding of Big-O notation for constant, logarithmic, linear, polynomial, and exponential time
- Understanding of the Halting problem and its significance