Eduqas A-Level Computer Science A500QS
Data Structures: Arrays, Records and Hash Tables
Stacks, Queues, Linked Lists and Trees
Boolean Logic and Simplification
Algorithms, Pseudo-Code and Programming Constructs
Variables, Scope, Parameters and Identifiers
Recursion and Modular Programming
Sorting Algorithms
Searching and Shortest-Path Algorithms
Big O Notation and Algorithm Efficiency
Validation, Verification and Testing
Data Compression
Programming Paradigms and Computer Languages
Systems Analysis, Maintenance and Documentation
System Design and Human-Computer Interaction
Software Engineering Tools and Translators
Computing, Society and the Law
Computer Architecture, the Processor and Assembly Language
Input, Output and Secondary Storage
Networks, Protocols and the Internet
Data Transmission and Network Performance
Number Systems and Binary Arithmetic
Data Types, Characters and Floating Point
Files, Records and File Organisation
Databases, Normalisation and Entity Modelling
SQL, Big Data and Distributed Systems
The Operating System and Its Modes
Interrupts, Memory Management and Scheduling
Types of Software System
Data Security, Cryptography and Attack
Big O Notation and Algorithm Efficiency
Comparing algorithms that do the same task
- 3 things to know
- Component 1
Overview
Two resources Big O is used to compare between algorithms and drawback that comparison hides in the hash table.
What you need to know
Answer each one before you reveal it.
State the two resources Big O is used to compare between algorithms.
Why is Big O a fair way to compare two algorithms written in different languages?
Questions from this subtopic
Each one with the model answer underneath.
- 1
State the two resources Big O is used to compare between algorithms.
Model answer
Big O compares execution time and memory requirement.
- 2
Why is Big O a fair way to compare two algorithms written in different languages?
Model answer
Big O measures the algorithm rather than the implementation. The language, compiler and processor affect the constant factor only.
- 3
Two algorithms sort the same list. One is O(n log n) and the other O(n²). Which should be chosen for a list of one million items, and why?
Model answer
The O(n log n) algorithm should be chosen. A million items cost it roughly twenty million operations, against a million million for the quadratic one.
- 4
Give one reason a programmer might still choose the algorithm with the worse complexity.
Model answer
A simpler algorithm is easier to write correctly and to maintain. On small or nearly sorted data it may also be faster in practice.
- 5
What does Big O fail to tell you about two algorithms in the same class?
Model answer
Big O hides the constant factor, so two O(n) algorithms can differ by a factor of ten in real running time.
- 6
Why can the same algorithm have different complexities for time and for space?
Model answer
Time and space are separate resources. A quicksort is O(n log n) in time and O(log n) in space, because the recursion stores far less than it processes.
Other ways to work this
The same content, four other ways.
What is inside Levo
Six ways to work the same material.
Every question in Big O Notation and Algorithm Efficiency, on a schedule.
Attempt a question from memory, write the correct version, then attempt it again. Levo records the jump between your first attempt and your last, and brings each question back on the day you are due to forget it.
Or £46 a year, about £3.83 a month. Cancel anytime.