Question 1
What must be true before binary search is used?
-
The list must be sorted
-
The list must contain only even numbers
-
The list must have no duplicates
-
The list must be stored in hexadecimal
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 idea of bubble sort?
-
Compare adjacent values and swap if out of order
-
Split the list into halves and merge
-
Always place the smallest item directly into position 0
-
Use a binary tree to reorder values
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 steps to solve a problem
-
A programming language used only for AI
-
A file format for storing code
-
Any list of ideas whether executable or not
Question 6
Why is pseudocode used when designing algorithms?
-
It is language-independent and focuses on logic
-
It runs faster than compiled code
-
It automatically creates a user interface
-
It can only be understood by Python programmers
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 the purpose of a trace table?
-
To track how variable values change step-by-step during an algorithm
-
To compress source code automatically
-
To convert pseudocode into machine code
-
To draw network topology diagrams
Question 11
What is an algorithm?
-
A step-by-step set of instructions
-
A programming language
-
A hardware component
-
A storage location
Question 12
What is sequencing?
-
Putting instructions in order
-
Repeating instructions
-
Making a decision in an algorithm
-
Removing unnecessary detail
Question 13
What is selection?
-
Making a decision in an algorithm
-
Repeating steps
-
Putting steps in order
-
Splitting into sub-tasks
Question 14
What is iteration?
-
Repeating a series of instructions
-
Choosing a path based on a condition
-
Putting instructions into a fixed order
-
Removing unnecessary detail from a problem
Question 15
What is a variable?
-
A named value that can change
-
Fixed value
-
Flowchart symbol
-
Output command
Question 16
What is a subroutine?
-
A reusable section of an algorithm
-
A single variable
-
A flowchart decision
-
An input value
Question 17
In a flowchart, what does a diamond mean?
-
Decision
-
Process
-
Input/output
-
Start/end
Question 18
In a flowchart, what does a rectangle mean?
-
Process
-
Decision
-
Input/output
-
Start/end
Question 19
In a flowchart, what does a parallelogram mean?
-
Input/output
-
Decision
-
Process
-
Start/end
Question 20
In a flowchart, what does an oval mean?
-
Start/end
-
Decision
-
Input/output
-
Process
Question 21
What is pseudocode?
-
Algorithm steps written in plain language
-
Instructions written directly in binary
-
A flowchart made only of symbols
-
A file format used to store source code
Question 22
Which loop repeats a set number of times?
-
For loop
-
While loop
-
If statement
-
Subroutine call
Question 23
Which loop runs while a condition remains true?
-
While loop
-
For loop
-
If statement
-
Return statement
Question 24
Which keyword starts a decision in code?
-
if
-
for
-
while
-
print
Question 25
Which are Boolean values?
-
True and False
-
Yes and No
-
On and Off
-
Up and Down
Question 26
What is decomposition?
-
Breaking a problem into smaller parts
-
Removing unnecessary detail from a problem
-
Making a decision in an algorithm
-
Repeating instructions while a condition is true
Question 27
What is abstraction?
-
Removing unnecessary detail
-
Breaking into parts
-
Repeating steps
-
Listing all cases
Question 28
What is a trace table for?
-
Tracking values at each step
-
Drawing flowcharts
-
Saving code
-
Encrypting files
Question 29
How does linear search work?
-
Checks each item in order
-
Starts in the middle
-
Sorts first
-
Checks first and last only
Question 30
Why are subroutines used in programs?
-
To reuse sections of code
-
To avoid requiring testing
-
To make code run faster
-
To prevent all logic errors
Question 31
What can binary search only be used on?
-
Sorted list
-
Random list only
-
List of text only
-
List with duplicates removed
Question 32
What is linear search most useful for?
-
Small or unsorted lists
-
Only sorted large lists
-
Encrypted lists only
-
Lists stored in ROM only
Question 33
What does bubble sort compare?
-
Adjacent items
-
Random pairs only
-
Only first and last items
-
Only prime positions
Question 34
How does merge sort work?
-
By splitting a list and then merging sorted halves
-
By swapping random values only
-
By checking only adjacent pairs
-
By using no comparisons
Question 35
In pseudocode, what does indentation usually show?
-
Block structure
-
Execution speed
-
Data type size
-
CPU frequency
Question 36
In a flowchart, what does a diamond represent?
-
A decision
-
A process step
-
Input/output only
-
A subroutine call only
Question 37
In a flowchart, what does a terminator represent?
-
Start or end
-
A condition only
-
A loop counter
-
A variable assignment only
Question 38
What does decomposition in algorithm design mean?
-
Breaking a problem into smaller sub-problems
-
Combining all data into one field
-
Removing all conditions
-
Avoiding all loops
Question 39
What does abstraction in algorithm design mean?
-
Ignoring unnecessary detail
-
Adding every detail
-
Using only low-level code
-
Avoiding all variables
Question 40
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 41
What does a condition return?
-
True or False
-
A number only
-
A text string only
-
A loop count
Question 42
What is debugging?
-
Finding and fixing errors
-
Running code once
-
Drawing a flowchart
-
Saving as PDF
Question 43
What is the worst-case time complexity of linear search?
-
\(O(n)\)
-
\(O(1)\)
-
\(O(log n)\)
-
\(O(n log n)\)
Question 44
What is the worst-case time complexity of binary search?
-
\(O(log n)\)
-
\(O(1)\)
-
\(O(n)\)
-
\(O(n^2)\)