Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Quiz on Search Algorithms

Total questions: 40

Worksheet time: 20mins

Name
Class
Date
1.

What data structure is used in BFS?

a)

Stack

b)

Queue

c)

Linked List

d)

Tree

2.

Which of the following is true for BFS?

a)

It uses LIFO structure

b)

It may not find the shortest path

c)

It explores all nodes at one depth before moving to the next

d)

It is faster than DFS

3.

BFS is optimal when:

a)

All actions have the same cost

b)

Graph has cycles

c)

Goal node is far

d)

Nodes have variable cost

4.

BFS is a type of:

a)

Informed search

b)

Blind search

c)

Heuristic search

d)

Local search

5.

Which traversal guarantees the shortest path in unweighted graphs?

a)

DFS

b)

A*

c)

UCS

d)

BFS

6.

What data structure is used in DFS?

a)

Queue

b)

Stack

c)

Heap

d)

Array

7.

DFS is not guaranteed to find the optimal path because:

a)

It is incomplete

b)

It explores the deepest path first

c)

It uses heuristics

d)

It doesn’t store visited nodes

8.

Which of these is most memory-efficient?

a)

BFS

b)

DFS

c)

A*

d)

UCS

9.

DFS may get stuck in:

a)

Heuristics

b)

Infinite loops in cyclic graphs

c)

Sorting

d)

Memory issues

10.

DFS is suitable when:

a)

Shallow solutions are preferred

b)

Deep solutions are needed

c)

Heuristics are used

d)

Uniform cost is important

11.

In DLS, a major problem can occur if:

a)

The limit is too high

b)

The limit is too low

c)

It uses a queue

d)

It doesn't mark visited nodes

12.

Depth-limited search prevents:

a)

High memory usage

b)

Infinite loops

c)

Optimal path

d)

All of the above

13.

What happens if the goal is beyond the depth limit in DLS?

a)

Goal is found

b)

Complete path is returned

c)

Failure is returned

d)

Best effort is shown

14.

DLS is a variant of:

a)

BFS

b)

DFS

c)

UCS

d)

A*

15.

Depth-limited search uses which approach?

a)

Iterative

b)

Recursive

c)

Breadth-wise

d)

Depth-wise with cutoff

16.

IDDFS combines the benefits of:

a)

DFS and A*

b)

BFS and DFS

c)

UCS and Greedy

d)

Best-first and DLS

17.

Why is IDDFS preferred over DFS?

a)

It uses heuristics

b)

It avoids getting stuck in infinite paths

c)

It is faster

d)

It doesn't repeat nodes

18.

IDDFS is complete and optimal when:

a)

Path cost is uniform

b)

Goal is at maximum depth

c)

Heuristics are present

d)

Stack is used

19.

In IDDFS, which search is performed repeatedly?

a)

DFS with increasing depth limit

b)

BFS with different strategies

c)

Greedy at each level

d)

UCS multiple times

20.

Which of the following consumes less memory like DFS and is complete like BFS?

a)

UCS

b)

A*

c)

IDDFS

d)

DLS

21.

UCS expands nodes based on:

a)

Depth

b)

Cost so far

c)

Heuristics

d)

Number of steps

22.

Which data structure is used in UCS?

a)

Queue

b)

Stack

c)

Priority queue

d)

Hash table

23.

UCS guarantees:

a)

Fastest path

b)

Shortest path

c)

Least number of nodes

d)

Deepest solution

24.

UCS can be inefficient when:

a)

Path cost varies

b)

Costs are equal

c)

Many paths have same cost

d)

All of the above

25.

UCS is a variant of:

a)

A*

b)

Greedy Search

c)

BFS

d)

DFS

26.

A uses which formula?

a)

f(n) = g(n)

b)

f(n) = h(n)

c)

f(n) = g(n) + h(n)

d)

f(n) = g(n) * h(n)

27.

In A, h(n) represents:

a)

Total cost

b)

Actual cost so far

c)

Estimated cost to goal

d)

Depth

28.

A is complete and optimal if:

a)

h(n) is admissible

b)

g(n) is ignored

c)

Heuristic is random

d)

Goal is deep

29.

A major drawback of A is:

a)

It is incomplete

b)

It doesn’t use heuristics

c)

High memory requirement

d)

It is slow

30.

Which search algorithm guarantees both completeness and optimality using heuristics?

a)

DFS

b)

UCS

c)

A*

d)

Best-first

31.

Best-first search selects node based on:

a)

Path cost

b)

Heuristic only

c)

Depth

d)

Random choice

32.

Best-first search may not be optimal because:

a)

It doesn’t use heuristics

b)

It ignores path cost

c)

It’s slow

d)

It uses backtracking

33.

Best-first search uses which data structure?

a)

Stack

b)

Queue

c)

Priority queue

d)

Array

34.

What happens if the heuristic in Best-first is poor?

a)

Faster performance

b)

Poor path choices

c)

No solution

d)

Optimal result

35.

Best-first search is a type of:

a)

Informed search

b)

Uninformed search

c)

Local search

d)

Recursive search

36.

TSP belongs to which complexity class?

a)

P

b)

NP

c)

NP-Complete

d)

Recursive

37.

What is the goal of TSP?

a)

Visit maximum cities

b)

Maximize path

c)

Minimize distance visiting all cities once

d)

Find the shortest path between two cities

38.

Which technique is commonly used to solve TSP approximately?

a)

DFS

b)

Greedy

c)

Genetic algorithms

d)

A*

39.

TSP is important in which domain?

a)

Web browsing

b)

Routing and logistics

c)

File compression

d)

Cloud computing

40.

If a salesman wants to return to starting city after visiting all cities with minimum cost, it is:

a)

Shortest path problem

b)

TSP

c)

Graph coloring

d)

Cycle detection