A developer needs to search for a specific name in a sorted list of 10,000 entries. Why would they choose a binary search instead of a linear search?
Pearson Edexcel IGCSE · Computer Science
Algorithms: Practice Questions
5 multiple-choice questions marked as you go, and 4 written questions with worked solutions. All on Algorithms.
How many times will the total variable be incremented in the following nested loop structure?
FOR \(i\) FROM 1 TO 4
FOR \(j\) FROM 1 TO 3
SET \(total\) TO \(total + 1\)
ENDFOR
ENDFOR
Which of these is the primary purpose of using a trace table during the development of an algorithm?
What is the maximum number of comparisons a binary search algorithm would need to find a value in a sorted list of \(15\) elements?
Given the list \([5, 2, 8, 1]\), what will the list look like after the first complete pass of a standard ascending bubble sort?
State the specific requirement that must be met by a data set before a binary search algorithm can be successfully performed.
Write your answer out first, then check it against the worked solution.
A sorted list contains 1,000 items. Determine the maximum number of comparisons required to find an item using a binary search and briefly justify your answer using powers of 2.
Write your answer out first, then check it against the worked solution.
A list of 1,000 student IDs is stored in an array. The IDs are already sorted in ascending order.
(a) State which search algorithm would be more efficient to find a specific ID in this sorted list.
(b) Explain why this algorithm is more efficient than a linear search by comparing the maximum number of checks required for each method.
Write your answer out first, then check it against the worked solution.
An array contains the following sequence of integers: [12, 5, 8, 2].
(a) Show the state of the array after each complete pass of a Bubble Sort algorithm until the numbers are in ascending order.
(b) Explain why a Merge Sort is generally considered more efficient than a Bubble Sort for very large datasets.
Write your answer out first, then check it against the worked solution.
* The content provided by thinka is generated by AI and may not always be accurate or up-to-date. Please use it as a supplementary resource and verify with official materials.
You've seen the model answer. Now get yours marked.
This page can show you how a good answer looks. It cannot tell you what your answer was missing. thinka marks your written work against the real mark scheme in about 15 seconds.
Want more questions like these? Get a fresh set on this topic, graded as you go.
Practice More