Graph

Graph

Professional Development

8 Qs

quiz-placeholder

Similar activities

OrenG WASA Quiz (Day2)

OrenG WASA Quiz (Day2)

Professional Development

10 Qs

Data Structure

Data Structure

Professional Development

13 Qs

Sharing Session : Proses Analisa Rating Perusahaan

Sharing Session : Proses Analisa Rating Perusahaan

Professional Development

10 Qs

Estratégias de Financiamento do CGL

Estratégias de Financiamento do CGL

Professional Development

8 Qs

BUK APOTEKER: INDEKS POLARITAS 01

BUK APOTEKER: INDEKS POLARITAS 01

Professional Development

10 Qs

BUK APOTEKER: INDEKS POLARITAS 02

BUK APOTEKER: INDEKS POLARITAS 02

Professional Development

10 Qs

Sakernas Day 1

Sakernas Day 1

Professional Development

10 Qs

Binary Search Tree

Binary Search Tree

Professional Development

10 Qs

Graph

Graph

Assessment

Quiz

Professional Development

Professional Development

Hard

Created by

Purushotham M

Used 4+ times

FREE Resource

8 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

Media Image

What would be the number of zeros in the adjacency matrix of the given graph?

10

6

16

0

2.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

Which of these adjacency matrices represents a simple graph?

[ [1, 0, 0], [0, 1, 0], [0, 1, 1] ]

[ [1, 1, 1], [1, 1, 1], [1, 1, 1] ]

[ [0, 0, 1], [0, 0, 0], [0, 0, 1] ]

[ [0, 0, 1], [1, 0, 1], [1, 0, 0] ]

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

What would be the DFS traversal of the given Graph?

AEDCB

ABCED

EDCBA

ADECB

4.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

Consider an undirected unweighted graph G. Let a breadth-first traversal of G be done starting from a node r. Let d(r, u) and d(r, v) be the lengths of the shortest paths from r to u and v respectively, in G. lf u is visited before v during the breadth-first traversal, which of the following statements is correct?

d(r, u) < d (r, v)

d(r, u) > d(r, v)

d(r, u) <= d (r, v)

None of the above

5.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

Media Image

Consider the following undirected graph with edge weights as shown:

The number of minimum-weight spanning trees of the graph is ___________

2.5

3.4

1.6

0.7

6.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

Media Image

Consider the following C++ code

0 1 3 2

0 2 3 1

0 1 2 3

0 2 1 3

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following algorithms can be used to most efficiently determine the presence of a cycle in a given graph ?

Depth First Search

Breadth First Search


Prim's Minimum Spanning Tree Algorithm

Kruskal's Minimum Spanning Tree Algorithm

8.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Let G be a graph with n vertices and m edges. What is the tightest upper bound on the running time on Depth First Search of G? Assume that the graph is represented using adjacency matrix.

O(n)

O(m+n)

O(n2)

O(mn)

Answer explanation

Depth First Search of a graph takes O(m+n) time when the graph is represented using adjacency list. In adjacency matrix representation, graph is represented as an "n x n" matrix. To do DFS, for every vertex, we traverse the row corresponding to that vertex to find all adjacent vertices (In adjacency list representation we traverse only the adjacent vertices of the vertex). Therefore time complexity becomes O(n2).