Search Header Logo

BFS DFS

Authored by Dhilip Kumar V TTS2750

Computers

University

Used 164+ times

BFS DFS
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

5 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

What is the shortest path from node A to node F?

A -> B -> D -> F

A -> C -> B -> E -> F

A -> F

A -> C -> E -> F

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Traversal of a graph is different from tree because

DFS of a graph uses stack, but inorrder traversal of a tree is recursive

There can be a loop in graph so we must maintain a visited flag for every vertex

BFS of a graph uses queue, but a time efficient BFS of a tree is recursive.

All of the above

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

The Breadth First Search algorithm has been implemented using the queue data structure. One possible order of visiting the nodes of the following graph is

MNOPQR

NQMPOR

QMNPRO

QMNPOR

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

Consider the following graph,

Among the following sequences:

(I) a b e g h f

(II) a b f e h g

(III) a b f h g e

(IV) a f g h b e

Which are depth first traversals of the above graph?

I, II and IV only

I and IV only

II, III and IV only

I, III and IV only

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

The data structure used for Depth First Algorithm is

STACK

QUEUE

BOTH STACK & QUEUE

NONE OF THESE

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?

Discover more resources for Computers