Graph data structure multiple choice questions with answers | FAQ | MCQ
What is a graph data structure? a) A non-linear data structure that consists of nodes and edges - Answer b) A linear data structure that consists of nodes and edges c) A hierarchical data structure that consists of nodes and edges d) A tree-based data structure that consists of nodes and edges
What is a directed graph? a) A graph where edges have a direction from one node to another - Answer b) A graph where edges have no direction c) A graph where edges are bidirectional d) A graph where nodes have a direction
What is the time complexity of searching for an element in an unweighted graph? a) O(1) b) O(n) - Answer c) O(log n) d) O(n log n)
What is the shortest path between two nodes in a graph called? a) Shortest route b) Shortest distance - Answer c) Shortest link d) Shortest connection
What is the purpose of weighted edges in a graph data structure? a) To represent the cost or distance between nodes - Answer b) To represent the direction of the edge c) To represent the number of nodes in the graph d) To represent the height of the graph
Comments
Post a Comment