wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

DAA 4th Sem

Total questions: 20

Worksheet time: 13mins

Name
Class
Date
1.

The best-case complexity of an algorithm refers to:

a)

The time complexity under the least favorable conditions

b)

The time complexity under the most favorable conditions

c)

The average time complexity

d)

The time complexity for recursive algorithms

2.

Which of the following is NOT a method used for solving recurrence relations?

a)

Substitution method

b)

Recursion tree method

c)

Master's theorem

d)

Divide and conquer method

3.

In Big-O notation, the function O(n^2) represents:

a)

Constant time complexity

b)

Linear time complexity

c)

Quadratic time complexity

d)

Exponential time complexity

4.

What is the primary characteristic of the Greedy algorithm?

a)

It always makes the optimal choice at every step

b)

It tries to explore all possibilities before making a choice

c)

It uses dynamic programming

d)

It avoids recursion

5.

Which of the following is a common application of Dynamic Programming?

a)

Sorting an array of integers

b)

Solving problems like the Knapsack Problem

c)

Searching a tree

d)

Implementing graph algorithms

6.

Which algorithmic technique is used in the Traveling Salesman Problem (TSP) to find the optimal solution by exploring all possible solutions?

a)

Dynamic Programming

b)

Brute-Force

c)

Greedy

d)

Backtracking

7.

Depth First Search (DFS) is most useful for:

a)

Finding the shortest path between two nodes in a graph

b)

Traversing a tree or graph by visiting each node once

c)

Sorting elements in a graph

d)

Searching in a binary search tree

8.

Which of the following is true for Breadth First Search (BFS)?

a)

It uses a stack for storing nodes

b)

It is faster than DFS for all graph types

c)

It explores all the nodes at the present depth level before moving on to nodes at the next depth level

d)

It does not find the shortest path in an unweighted graph

9.

Dijkstra's Algorithm is used to find:

a)

Minimum spanning tree

b)

Shortest path in a weighted graph

c)

The path with the largest weight in a graph

d)

Transitive closure of a graph

10.

In Prim’s Algorithm, what is the goal?

a)

To find the minimum spanning tree

b)

To find the shortest path between nodes

c)

To explore all the vertices in a graph

d)

To find the maximum weight edge

11.

The Topological Sorting of a directed acyclic graph (DAG) results in:

a)

A tree structure

b)

A sorted list of vertices such that for every directed edge u→v, vertex u comes before v

c)

A cyclic graph

d)

A minimal spanning tree

12.

The Ford-Fulkerson Algorithm is used for solving:

a)

Minimum spanning tree

b)

Network flow problems

c)

Shortest path problems

d)

Traveling salesman problems

13.

In Backtracking, the process of moving back in the search tree is known as:

a)

Exploring

b)

Branching

c)

Pruning

d)

Backtracking

14.

In the Knapsack Problem, if the items are divisible, which algorithm would be more efficient?

a)

Greedy Algorithm

b)

Dynamic Programming

c)

Brute Force

d)

Backtracking

15.

The (a)   algorithm design strategy makes the locally optimal choice at each stage with the hope of finding the global optimum.

16.

The (a)   method for solving recurrences involves drawing a tree-like diagram to visualize the recurrence’s computation at each level.

17.

The (a)   algorithm is commonly used to find the shortest path in a graph when all edges have non-negative weights.

18.

The (a)   problem is an example of an NP-hard problem that can be solved using dynamic programming to find the optimal solution efficiently.

19.

(a)   search is a graph traversal technique where we visit all the vertices of a graph level by level, starting from the source vertex.

20.

In a DFS (Depth First Search) traversal of a graph, we use which data structure?

a)

Queue

b)

Stack

c)

Array

d)

Priority Queue