NEW
Font size
WorksheetsFundamentals of Algorithms - Unit 1 - Test 1
Total questions: 15
Worksheet time: 8mins
What is an algorithm?
A programming language
A step-by-step procedure to solve a problem
A type of data structure
A hardware component
Which of the following is NOT a characteristic of a good algorithm?
Finiteness
Ambiguity
Definiteness
Efficiency
What is the purpose of pseudo code in algorithm design?
To execute the algorithm directly
To provide a high-level description independent of programming languages
To optimize the algorithm’s memory usage
To replace programming languages entirely
Which of the following is an example of a valid pseudo code statement?
int x = 5;
SET x TO 5
x := 5;
x = 5 in Python
What does space complexity of an algorithm measure?
The time taken by the algorithm to execute
The amount of memory required by the algorithm
The number of operations performed
The number of input variables
Which of the following represents the total space complexity of an algorithm?
Fixed space + Variable space
Time complexity + Auxiliary space
Input size + Output size
Recursion depth + Stack size
Time complexity of an algorithm is typically analyzed in terms of:
The number of iterations in a loop
The amount of memory used
The number of basic operations as a function of input size
The programming language used
Which asymptotic notation describes the worst-case performance of an algorithm?
Big-O (O)
Big-Omega (Ω)
Big-Theta (Θ)
Little-o (o)
What does O(n²) indicate about an algorithm’s time complexity?
The algorithm runs in constant time
The algorithm’s running time grows quadratically with input size
The algorithm’s running time is independent of input size
The algorithm runs in linear time
Which of the following notations provides a tight bound for an algorithm’s performance?
Big-O (O)
Big-Omega (Ω)
Big-Theta (Θ)
Little-o (o)
An algorithm with time complexity O(1) is known as:
Linear time algorithm
Constant time algorithm
Quadratic time algorithm
Exponential time algorithm
What is the space complexity of an algorithm that uses a fixed-size array of 100 integers?
O(1)
O(n)
O(n²)
O(log n)
Which of the following is an example of an algorithm with logarithmic time complexity?
Linear search
Bubble sort
Binary search
Matrix multiplication
In pseudo code, how would you express a loop that iterates from 1 to n?
FOR i = 1 TO n DO
WHILE (i <= n)
LOOP i FROM 1 UNTIL n
All of the above
If an algorithm’s time complexity is O(n log n), which of the following is true?
It is faster than O(n²) for large inputs
It is slower than O(n) for all inputs
It is equivalent to O(n²)
It is constant time
