BFS DFS

BFS DFS

University

5 Qs

quiz-placeholder

Similar activities

DS Quiz1

DS Quiz1

University

10 Qs

DSA - Intro

DSA - Intro

University

10 Qs

Pertemuan 1 Struktur Data

Pertemuan 1 Struktur Data

University

10 Qs

DDT1B_Pre-test_080322

DDT1B_Pre-test_080322

University

10 Qs

AI

AI

University

10 Qs

Data Structures Quiz-2

Data Structures Quiz-2

University

10 Qs

Stacks/Queues

Stacks/Queues

University

9 Qs

EC8393_FDS_MODEL_EXAM_1_PART B

EC8393_FDS_MODEL_EXAM_1_PART B

University

10 Qs

BFS DFS

BFS DFS

Assessment

Quiz

Computers

University

Hard

Created by

Dhilip Kumar V TTS2750

Used 152+ times

FREE Resource

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