solution - Data Structures and Algorithms : Graph (Test 1)

Question : A graph consists of:

Solution :
48920260620051918 Correct Answer : Vertices and Edges

Description -

Data Structures and Algorithms : Graph (Test 1)

Question : Which data structure is mainly used in BFS?

Solution :
854220260620051830 Correct Answer : Queue

Description -

Data Structures and Algorithms : Graph (Test 1)

Question : Which data structure is mainly used in DFS?

Solution :
170620260620051740 Correct Answer : Stack

Description -

Data Structures and Algorithms : Graph (Test 1)

Question : A graph with no cycles is called:

Solution :
180220260620051710 Correct Answer : Acyclic Graph

Description -

Data Structures and Algorithms : Graph (Test 1)

Question : In an undirected graph, an edge (A,B) means:

Solution :
44320260620051633 Correct Answer : Both directions

Description -

Data Structures and Algorithms : Graph (Test 1)

Question : Which representation uses a 2D array?

Solution :
681220260620051552 Correct Answer : Adjacency Matrix

Description -

Data Structures and Algorithms : Graph (Test 1)

Question : The maximum number of edges in a simple undirected graph with n vertices is:

Solution :
750820260620051515 Correct Answer : n(n−1)/2

Description -

Data Structures and Algorithms : Graph (Test 1)

Question : A graph where every vertex is connected to every other vertex is:

Solution :
242420260620051438 Correct Answer : Complete Graph

Description -

Data Structures and Algorithms : Graph (Test 1)

Question : BFS stands for:

Solution :
977420260620051350 Correct Answer : Breadth First Search

Description -

Data Structures and Algorithms : Graph (Test 1)

Question : DFS stands for:

Solution :
761220260620051303 Correct Answer : Depth First Search

Description -

Data Structures and Algorithms : Graph (Test 1)

Question : Time complexity of BFS using adjacency list is:

Solution :
524520260620051216 Correct Answer : O(V+E)

Description -

Data Structures and Algorithms : Graph (Test 1)

Question : Time complexity of DFS using adjacency list is:

Solution :
799720260620051135 Correct Answer : O(V+E)

Description -

Data Structures and Algorithms : Graph (Test 1)

Question : Which graph representation is better for sparse graphs?

Solution :
405620260620051057 Correct Answer : Adjacency List

Description -

Data Structures and Algorithms : Graph (Test 1)

Question : Memory required by Adjacency Matrix:

Solution :
29020260620051019 Correct Answer : O(V²)

Description -

Data Structures and Algorithms : Graph (Test 1)

Question : Minimum Spanning Tree exists only in:

Solution :
921820260620050933 Correct Answer : Connected Weighted Graph

Description -

Data Structures and Algorithms : Graph (Test 1)

Question : Number of edges in an MST with n vertices:

Solution :
518820260620050842 Correct Answer : n−1

Description -

Data Structures and Algorithms : Graph (Test 1)

Question : Prim's Algorithm is used for:

Solution :
159520260620050735 Correct Answer : MST (Minimum Spanning Tree)

Description -

Data Structures and Algorithms : Graph (Test 1)

Question : Kruskal's Algorithm selects:

Solution :
681320260620050631 Correct Answer : Minimum weight edge first

Description -

Data Structures and Algorithms : Graph (Test 1)

Question : Which traversal can find shortest path in an unweighted graph?

Solution :
665120260620050542 Correct Answer : BFS

Description -

Data Structures and Algorithms : Graph (Test 1)

Question : A graph with direction on edges is:

Solution :
595220260620050505 Correct Answer : Directed Graph

Description -

Data Structures and Algorithms : Graph (Test 1)

Question : Time complexity of Prim's Algorithm using Min Heap:

Solution :
487020260620050407 Correct Answer : O(E log V)

Description -

Data Structures and Algorithms : Graph (Test 1)

Question : Time complexity of Kruskal's Algorithm:

Solution :
521920260620050247 Correct Answer : O(E log E)

Description -

Data Structures and Algorithms : Graph (Test 1)

Question : Which data structure is used in Kruskal's Algorithm to detect cycles?

Solution :
593020260620050208 Correct Answer : Union-Find (Disjoint Set)

Description -

Data Structures and Algorithms : Graph (Test 1)

Question : A graph where each edge has a weight is:

Solution :
649520260620050112 Correct Answer : Weighted Graph

Description -

Data Structures and Algorithms : Graph (Test 1)

Question : If a graph has V vertices, adjacency matrix contains:

Solution :
30820260620050007 Correct Answer : V² cells

Description -

Data Structures and Algorithms : Graph (Test 1)

Question : Which traversal may get stuck in deep paths before exploring neighbors?

Solution :
933820260620045923 Correct Answer : DFS

Description -

Data Structures and Algorithms : Graph (Test 1)

Question : A tree is:

Solution :
446920260620045828 Correct Answer : Connected Acyclic Graph

Description -

Data Structures and Algorithms : Graph (Test 1)

Question : In a complete graph with 5 vertices, number of edges is:

Solution :
98820260620045757 Correct Answer : 10

Description -

Data Structures and Algorithms : Graph (Test 1)

Question : Which graph representation allows faster edge lookup?

Solution :
927920260620045717 Correct Answer : Adjacency Matrix

Description -

Data Structures and Algorithms : Graph (Test 1)

Question : Which statement is TRUE about MST(Minimum Spanning Tree) ?

Solution :
954920260620045635 Correct Answer : Connects all vertices with minimum total weight

Description -

Data Structures and Algorithms : Graph (Test 1)