Question 1
Which property must a list have before binary search?
-
Items arranged in sorted order
-
Items arranged in random order
-
Items stored as hexadecimal values
-
Items restricted to unique values
Question 2
In linear search, what is the maximum number of checks needed to find a value in a list of n items (worst case)?
-
\(n\)
-
\(1\)
-
\(\log_2(n)\)
-
\(n/2\)
Question 3
What is the key step in bubble sort?
-
Compare adjacent items and swap those out of order
-
Split the list and merge sorted halves
-
Select the smallest remaining item for the next position
-
Insert each item into a growing sorted section
Question 4
What does insertion sort build over time?
-
A growing sorted section of the list
-
A randomised section to improve speed
-
A stack of unsorted values
-
Two identical copies of the original list
Question 5
What best describes an algorithm?
-
A finite sequence of unambiguous problem-solving steps
-
Source code written in a particular language
-
Input data stored for a program
-
An unordered list of possible ideas
Question 6
Why is pseudocode useful when designing algorithms?
-
It shows logic without depending on one language
-
It executes faster than compiled machine code
-
It automatically creates the user interface
-
It tests the finished program on hardware
Question 7
Which test data type checks values exactly on the edge of valid input range?
-
Boundary
-
Normal
-
Erroneous
-
Live
Question 8
Which test data type uses typical valid values?
-
Normal
-
Boundary
-
Erroneous
-
Exhaustive
Question 9
Which test data type deliberately uses invalid input?
-
Erroneous
-
Normal
-
Boundary
-
Expected
Question 10
What is a trace table used for?
-
Tracking variable values as an algorithm runs
-
Showing decisions and processes as symbols
-
Listing test cases and expected results
-
Describing logic without language syntax
Question 11
What does selection sort do on each pass?
-
Selects the smallest remaining item for the next position
-
Swaps every adjacent out-of-order pair
-
Splits the list into equal halves
-
Inserts the next item into a sorted section
Question 12
What is linear search most useful for?
-
Small or unsorted lists
-
Sorted large lists
-
Encrypted lists
-
Lists stored in ROM
Question 13
What is an advantage of merge sort over bubble sort for a large list?
-
It is generally faster
-
It needs less storage
-
It is simpler to code
-
It needs presorted data
Question 14
How does merge sort work?
-
Splits the list, then merges sorted sublists
-
Swaps adjacent out-of-order items
-
Selects the smallest item for each position
-
Inserts each item into a growing sorted section
Question 15
In pseudocode, what does indentation usually show?
-
Block structure
-
Execution speed
-
Data type size
-
CPU frequency
Question 16
In a flowchart, what does a diamond represent?
-
A decision
-
A process step
-
Input/output
-
A subroutine call
Question 17
In a flowchart, what does a terminator represent?
-
Start or end
-
A condition
-
A loop counter
-
A variable assignment
Question 18
What does decomposition mean in algorithm design?
-
Breaking a problem into smaller subproblems
-
Removing detail that does not affect the solution
-
Finding similarities between several problems
-
Combining data into one large structure
Question 19
What does abstraction mean in algorithm design?
-
Removing detail that does not affect the solution
-
Breaking a problem into smaller subproblems
-
Finding similarities between several problems
-
Adding implementation detail before design
Question 20
What is validation in algorithm design?
-
Checking input follows required rules
-
Converting pseudocode to machine code
-
Sorting data into ascending order
-
Encrypting stored passwords
Question 21
Why can linear search suit a frequently changing list?
-
The list need not be sorted
-
One item needs checking
-
The search area halves
-
A search tree is required
Question 22
What is an advantage of binary search on a large sorted list?
-
It usually needs fewer comparisons
-
It can search unsorted data directly
-
It checks every item in order
-
It sorts the list while searching
Question 23
What is an advantage of bubble sort over merge sort for a short list?
-
It is simpler to implement
-
It generally uses fewer comparisons
-
It splits the list recursively
-
It needs one comparison per list
Question 24
Which is a disadvantage of merge sort?
-
It needs extra storage while merging
-
It must compare every pair of items
-
It requires presorted data
-
It needs many adjacent swaps
Question 25
What does a binary search do after comparing with the middle item?
-
Discards half of the remaining search area
-
Searches both halves of the list
-
Moves to the next item in order
-
Compares every item in the list
Question 26
For n items, how many full passes can bubble sort need in the worst case?
-
n − 1
-
1
-
log₂ n
-
n²
Question 27
What is a subroutine?
-
A named block of code that performs a task
-
A variable that stores one value
-
A condition used for selection
-
A loop that repeats instructions
Question 28
Why use decomposition when designing an algorithm?
-
Make a complex problem more manageable
-
Remove the need for testing
-
Choose the programming language automatically
-
Make every subproblem run in constant time
Question 29
What is a dry run?
-
Manually tracing an algorithm with test data
-
Running compiled code on hardware
-
Checking the spelling of source code
-
Writing a test plan
Question 30
Which statement about algorithms is correct?
-
Two algorithms can solve one problem with different efficiency
-
One problem determines one possible algorithm
-
Algorithm efficiency depends only on programming language
-
Changing input size leaves running time unchanged