wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Fundamentals of Algorithms - Unit 1 - Test 1

Total questions: 15

Worksheet time: 8mins

Name
Class
Date
1.

What is an algorithm?

a)

A programming language

b)

A step-by-step procedure to solve a problem

c)

A type of data structure

d)

A hardware component

2.

Which of the following is NOT a characteristic of a good algorithm?

a)

Finiteness

b)

Ambiguity

c)

Definiteness

d)

Efficiency

3.

What is the purpose of pseudo code in algorithm design?

a)

To execute the algorithm directly

b)

To provide a high-level description independent of programming languages

c)

To optimize the algorithm’s memory usage

d)

To replace programming languages entirely

4.

Which of the following is an example of a valid pseudo code statement?

a)

int x = 5;

b)

SET x TO 5

c)

x := 5;

d)

x = 5 in Python

5.

What does space complexity of an algorithm measure?

a)

The time taken by the algorithm to execute

b)

The amount of memory required by the algorithm

c)

The number of operations performed

d)

The number of input variables

6.

Which of the following represents the total space complexity of an algorithm?

a)

Fixed space + Variable space

b)

Time complexity + Auxiliary space

c)

Input size + Output size

d)

Recursion depth + Stack size

7.

Time complexity of an algorithm is typically analyzed in terms of:

a)

The number of iterations in a loop

b)

The amount of memory used

c)

The number of basic operations as a function of input size

d)

The programming language used

8.

Which asymptotic notation describes the worst-case performance of an algorithm?

a)

Big-O (O)

b)

Big-Omega (Ω)

c)

Big-Theta (Θ)

d)

Little-o (o)

9.

What does O(n²) indicate about an algorithm’s time complexity?

a)

The algorithm runs in constant time

b)

The algorithm’s running time grows quadratically with input size

c)

The algorithm’s running time is independent of input size

d)

The algorithm runs in linear time

10.

Which of the following notations provides a tight bound for an algorithm’s performance?

a)

Big-O (O)

b)

Big-Omega (Ω)

c)

Big-Theta (Θ)

d)

Little-o (o)

11.

An algorithm with time complexity O(1) is known as:

a)

Linear time algorithm

b)

Constant time algorithm

c)

Quadratic time algorithm

d)

Exponential time algorithm

12.

What is the space complexity of an algorithm that uses a fixed-size array of 100 integers?

a)

O(1)

b)

O(n)

c)

O(n²)

d)

O(log n)

13.

Which of the following is an example of an algorithm with logarithmic time complexity?

a)

Linear search

b)

Bubble sort

c)

Binary search

d)

Matrix multiplication

14.

In pseudo code, how would you express a loop that iterates from 1 to n?

a)

FOR i = 1 TO n DO

b)

WHILE (i <= n)

c)

LOOP i FROM 1 UNTIL n

d)

All of the above

15.

If an algorithm’s time complexity is O(n log n), which of the following is true?

a)

It is faster than O(n²) for large inputs

b)

It is slower than O(n) for all inputs

c)

It is equivalent to O(n²)

d)

It is constant time