
Graph

Quiz
•
Professional Development
•
Professional Development
•
Hard
Purushotham M
Used 4+ times
FREE Resource
8 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
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
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
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
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).
Similar Resources on Wayground
13 questions
FAMASUL - Descomplicando o ATEG

Quiz
•
Professional Development
13 questions
Data Structure

Quiz
•
Professional Development
10 questions
Show do Centavo

Quiz
•
Professional Development
10 questions
Taules de mescles 2

Quiz
•
Professional Development
11 questions
ECG 2

Quiz
•
Professional Development
6 questions
Grundlagen Elektrotechnik - Part 1

Quiz
•
Professional Development
10 questions
Aruga at Kalinga

Quiz
•
University - Professi...
10 questions
ANOVA, ANCOVA, Correlation & Regression

Quiz
•
Professional Development
Popular Resources on Wayground
50 questions
Trivia 7/25

Quiz
•
12th Grade
11 questions
Standard Response Protocol

Quiz
•
6th - 8th Grade
11 questions
Negative Exponents

Quiz
•
7th - 8th Grade
12 questions
Exponent Expressions

Quiz
•
6th Grade
4 questions
Exit Ticket 7/29

Quiz
•
8th Grade
20 questions
Subject-Verb Agreement

Quiz
•
9th Grade
20 questions
One Step Equations All Operations

Quiz
•
6th - 7th Grade
18 questions
"A Quilt of a Country"

Quiz
•
9th Grade