wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Multiple-Choice Quiz: Algorithms Lab 2

Total questions: 10

Worksheet time: 5mins

Name
Class
Date
1.

What is the time complexity of the standard matrix multiplication algorithm?

a)

O(n)

b)

O(n²)

c)

O(n³)

d)

O(2ⁿ)

2.

What is the output matrix size when multiplying two matrices of size n × n?

a)

n × n

b)

2n × 2n

c)

n × 2n

d)

It depends on the input

3.

If matrix A has dimensions 3 × 4 and matrix B has dimensions 4 × 2, what will be the dimensions of the resultant matrix C?

a)

4 × 4

b)

3 × 2

c)

4 × 2

d)

3 × 4

4.

What will be the value of C[1][1] after multiplying the following matrices? A =[1 2 3 4] B =[2 0 1 3]

a)

3

b)

4

c)

5

d)

7

5.

Which of the following is an efficient way to represent a graph with a large number of edges (dense graph)?

a)

Adjacency List

b)

Adjacency Matrix

c)

Edge List

d)

DFS Tree

6.

Which of the following is NOT a valid type of graph?

a)

Directed Graph

b)

Weighted Graph

c)

Unsorted Graph

d)

Cyclic Graph

7.

Which graph representation is best suited for sparse graphs (few edges)?

a)

Adjacency Matrix

b)

Adjacency List

c)

Both are equally good

d)

None of the above

8.

In an adjacency matrix representation of a graph, what does the value matrix[i][j] = 1 signify?

a)

There is an edge from node i to node j

b)

There is no edge between i and j

c)

There is an edge from node j to node i

d)

The graph is undirected

9.

Which of the following data structures is most commonly used to implement an adjacency list?

a)

2D Array

b)

Queue

c)

Linked List or Vector

d)

Stack

10.

What is the space complexity of an adjacency matrix representation for a graph with V vertices?

a)

O(V)

b)

O(V²)

c)

O(E)

d)

O(V log V)