adplus-dvertising

Welcome to the Graphs MCQs Page

Dive deep into the fascinating world of Graphs with our comprehensive set of Multiple-Choice Questions (MCQs). This page is dedicated to exploring the fundamental concepts and intricacies of Graphs, a crucial aspect of Data Structures and Algorithms. In this section, you will encounter a diverse range of MCQs that cover various aspects of Graphs, from the basic principles to advanced topics. Each question is thoughtfully crafted to challenge your knowledge and deepen your understanding of this critical subcategory within Data Structures and Algorithms.

frame-decoration

Check out the MCQs below to embark on an enriching journey through Graphs. Test your knowledge, expand your horizons, and solidify your grasp on this vital area of Data Structures and Algorithms.

Note: Each MCQ comes with multiple answer choices. Select the most appropriate option and test your understanding of Graphs. You can click on an option to test your knowledge before viewing the solution for a MCQ. Happy learning!

Graphs MCQs | Page 10 of 17

Q91.
For some sparse graph an adjacency list is more space efficient against an adjacency matrix.
Discuss
Answer: (a).True
Q92.
Time complexity to find if there is an edge between 2 particular vertices is _________
Discuss
Answer: (a).O(V)
Q93.
For the given conditions, which of the following is in the correct order of increasing space requirement?
i) Undirected, no weight

ii) Directed, no weight

iii) Directed, weighted

iv) Undirected, weighted
Discuss
Answer: (a).ii iii i iv
Q94.
Space complexity for an adjacency list of an undirected graph having large values of V (vertices) and E (edges) is __________
Discuss
Answer: (c).O(E)
Q95.
Complete the given snippet of code for the adjacency list representation of a weighted directed graph.
class neighbor
        {
  int vertex, weight;
  ____ next;
 }
 
 class vertex
        {
  string name;
  _____ adjlist;
 }
 
 vertex adjlists[101];
Discuss
Answer: (c).neighbor, neighbor
Q96.
In which case adjacency list is preferred in front of an adjacency matrix?
Discuss
Answer: (b).Sparse graph
Q97.
To create an adjacency list C++’s map container can be used.
Discuss
Answer: (a).True
Q98.
What would be the time complexity of the following function which adds an edge between two vertices i and j, with some weight ‘weigh’ to the graph having V vertices?
vector<int> adjacent[15] ;
vector<int> weight[15]; 
 
void addEdge(int i,int j,int weigh) 
{  
 adjacent[a].push_back(i); 
 adjacent[b].push_back(j); 
 weight[a].push_back(weigh); 
 weight[b].push_back(weigh); 
}
Discuss
Answer: (a).O(1)
Q99.
Given a plane graph, G having 2 connected component, having 6 vertices, 7 edges and 4 regions. What will be the number of connected components?

a.

1

b.

2

c.

3

d.

4

Discuss
Answer: (b).2
Q100.
Number of vertices with odd degrees in a graph having a eulerian walk is ________
Discuss
Answer: (d).either 0 or 2

Suggested Topics

Are you eager to expand your knowledge beyond Data Structures and Algorithms? We've curated a selection of related categories that you might find intriguing.

Click on the categories below to discover a wealth of MCQs and enrich your understanding of Computer Science. Happy exploring!