Lesson 4.3.4.1
4.3.4.1 Linear and binary search Quiz: AQA Computer Science, Unit 3
20 questions
In partnership with Revision Ninja
Lesson 4.3.4.1, Linear and binary search: 20 multiple choice questions for the AQA Computer Science (7517), Unit 3: Fundamentals of algorithms, 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
-
Linear search has which time complexity?
- O(n)
- O(1)
- O(n log n)
- O(log n)
-
Binary search has which time complexity?
- O(log n)
- O(1)
- O(n log log n)
- O(n)
-
What condition must data meet before a binary search can be performed?
- Unsorted
- Hashed
- Sorted
- Indexed
-
Which search examines each element in turn from the start of the list?
- Binary search
- Linear search
- Hash search
- Binary tree search
-
In a binary search, if the middle item is smaller than the target, which section is searched next?
- Right half
- Whole list
- First quarter
- Left half
-
Which search algorithm is most appropriate for a single search on an unsorted list?
- Linear search
- Hash search
- Binary search
- Tree search
-
Binary search for 23 is applied to the sorted list [2, 5, 8, 12, 16, 23, 38, 56, 72, 91]. How many comparisons are made?
- 3
- 2
- 1
- 4
-
Linear search for 91 in the sorted list [2, 5, 8, 12, 16, 23, 38, 56, 72, 91] is performed. How many comparisons are made?
- 9
- 10
- 5
- 100
-
What is the maximum number of comparisons needed by binary search on a sorted list of 1024 items?
- 512
- 1024
- 10
- 5
-
A linear search of an unsorted list of 500 items finds a target that is present, on average. How many comparisons are needed on average?
- 500
- 250
- 1
- 250000
-
Roughly how many comparisons does binary search need in the worst case on one million sorted items?
- 10
- 20
- 500000
- 1000
-
What is the time complexity of performing a binary search on a sorted list?
- O(n)
- O(n^2)
- O(1)
- O(log n)
-
Binary search for 4 is applied to the sorted list [1, 3, 5, 7, 9, 11]. How many comparisons are made before the search ends?
- 4
- 2
- 3
- 6
-
Which expression gives the worst-case number of comparisons for binary search on n sorted items?
- log2 n, rounded up
- n
- n squared
- n / 2
-
A binary search is run on 15 sorted items for a value that is not present. What is the maximum number of comparisons?
- 15
- 4
- 3
- 5
-
What maximum number of comparisons does binary search need for one million items?
- 500000
- 1000
- 20
- 1000000
-
What requirement must a list meet before a binary search can be performed?
- Must be sorted
- Must be indexed
- Must be numeric
- Must be dynamic
-
Binary search for 60 is applied to the sorted list [10, 20, 30, 40, 50, 60, 70] using zero-based indexing. At which index is 60 found?
- 60
- 6
- 5
- 4
-
What logarithmic base represents the repeated halving of search space in binary search?
- Base 10
- Base 2
- Base n
- Base e
-
A sorted list of 1023 items is searched using binary search in the worst case. How many comparisons are needed at most?
- 10
- 50
- 511
- 11
Related quizzes
- Breadth-first and depth-first search Quiz · 4.3.1.1 · 20 questions
- Pre-order, post-order and in-order traversal Quiz · 4.3.2.1 · 20 questions
- Infix to Reverse Polish notation Quiz · 4.3.3.1 · 20 questions
- Binary tree search Quiz · 4.3.4.3 · 20 questions
- Bubble sort Quiz · 4.3.5.1 · 20 questions
- Merge sort Quiz · 4.3.5.2 · 20 questions
- Dijkstra's shortest path algorithm Quiz · 4.3.6.1 · 20 questions
- Data types Quiz · 4.1.1.1 · 20 questions
- Entity relationship modelling Quiz · 4.10.1.1 · 20 questions
- Big Data Quiz · 4.11.1.1 · 20 questions