Lesson 4.4.4.3
4.4.4.3 Order of complexity Quiz: AQA Computer Science, Unit 4
20 questions
In partnership with Revision Ninja
Lesson 4.4.4.3, Order of complexity: 20 multiple choice questions for the AQA Computer Science (7517), Unit 4: Theory of computation, written with Revision Ninja.
Host it live on the board and students join with a game code on their own devices, or revise alone with Free Play. The answers are revealed in the game.
The 20 questions
-
What is the Big-O notation for constant time?
- O(n^2)
- O(1)
- O(n)
- O(log n)
-
Binary search is an example of which order of complexity?
- Logarithmic time
- Exponential time
- Constant time
- Linear time
-
Linear search is an example of which order of complexity?
- Exponential time
- Logarithmic time
- Constant time
- Linear time
-
Bubble sort is an example of which order of complexity?
- Polynomial time, quadratic in this case
- Logarithmic time
- Linear time
- Constant time
-
Which algorithm has exponential time complexity?
- An algorithm that checks every subset of n items
- An algorithm that reads each item once
- An algorithm that halves its input each step
- An algorithm that accesses one array element
-
Which growth class is fastest-growing among O(n), O(log n), O(n^2) and O(2^n)?
- O(log n)
- O(n)
- O(2^n)
- O(n^2)
-
A loop runs once for each value of i from 1 to n, with a constant amount of work each time. What is the complexity?
- O(n)
- O(n^2)
- O(log n)
- O(1)
-
Two nested loops each run from 1 to n with constant work in the body. What is the complexity?
- O(n)
- O(n^2)
- O(log n)
- O(2^n)
-
A loop doubles i each iteration from 1 until it reaches n. What is the complexity?
- O(n)
- O(log n)
- O(n^2)
- O(1)
-
The inner loop runs i times for i from 1 to n. What is the total number of inner iterations?
- n
- n(n + 1) / 2
- 2^n
- log n
-
Which Big-O expression describes 3n^2 + 5n + 2?
- O(n^2)
- O(2^n)
- O(n^3)
- O(n)
-
Which Big-O expression describes 7n log n + 100?
- O(n)
- O(log n)
- O(n^2)
- O(n log n)
-
Which function grows faster as n tends to infinity?
- Neither grows
- n^3
- 1000n^2
- They grow at the same rate
-
An algorithm runs in O(2^n) time. Roughly how many steps does it need for n = 20?
- About 1 million
- 20
- 400
- About 1 billion
-
Why does Big-O notation ignore constant factors?
- Because constants are always zero
- Because it describes the growth rate as the input becomes large
- Because constants never affect running time
- Because Big-O only applies to strings
-
When n doubles, how does the running time of an O(log n) algorithm change?
- It doubles
- It is unchanged
- It increases by a fixed amount
- It quadruples
-
How many permutations are there of 5 distinct items?
- 120
- 3125
- 60
- 24
-
Which statement about n! is correct?
- It grows faster than any fixed exponential c^n for large n
- It is a logarithmic function
- It is always equal to n squared
- It grows more slowly than n^2
-
Which statement is true for large n?
- n log n grows faster than n^1.5
- n^1.5 is O(n log n)
- n log n is O(n^1.5)
- They grow identically
-
What is the Big-O of an algorithm that takes n + log n steps?
- O(n^2)
- O(2^n)
- O(log n)
- O(n)
Related quizzes
- Problem-solving and algorithms Quiz · 4.4.1.1 · 20 questions
- Abstraction Quiz · 4.4.1.3 · 20 questions
- Problem reduction and decomposition Quiz · 4.4.1.8 · 20 questions
- Composition Quiz · 4.4.1.10 · 20 questions
- Automation Quiz · 4.4.1.11 · 20 questions
- Finite state machines Quiz · 4.4.2.1 · 20 questions
- Regular expressions Quiz · 4.4.2.3 · 20 questions
- Backus-Naur Form and syntax diagrams Quiz · 4.4.3.1 · 20 questions
- Comparing algorithms Quiz · 4.4.4.1 · 20 questions
- Limits of computation and computable problems Quiz · 4.4.4.4 · 20 questions