__ Graph MCQs Questions:-__

- What is a graph in computer science? a. A data structure consisting of nodes and edges. b. A data structure consisting of nodes only. c. A data structure consisting of edges only. d. A data structure consisting of nodes, edges, and weights.

**Answer: a**

- What are the two components of a graph? a. Nodes and weights b. Edges and weights c. Nodes and edges d. Nodes and costs

**Answer: c**

- What is an adjacency matrix? a. An array of linked lists used to represent a graph. b. A 2D array of size V x V used to represent a graph. c. A list of nodes used to represent a graph. d. A list of edges used to represent a graph.

**Answer: b**

- What is an adjacency list? a. A 2D array of size V x V used to represent a graph. b. An array of linked lists used to represent a graph. c. A list of nodes used to represent a graph. d. A list of edges used to represent a graph.

**Answer: b**

- What is the difference between (u, v) and (v, u) in a directed graph? a. There is no difference. b. (u, v) means there is an edge from u to v, while (v, u) means there is an edge from v to u. c. (u, v) means there is an edge from v to u, while (v, u) means there is an edge from u to v. d. (u, v) means there is a node u and a node v, while (v, u) means there is a node v and a node u.

**Answer: b**

- What is the time complexity of breadth-first traversal for a graph using an adjacency list representation? a. O(V) b. O(E) c. O(V+E) d. O(V * V)

**Answer: c**

- What is the time complexity of breadth-first traversal for a graph using an adjacency matrix representation? a. O(V) b. O(E) c. O(V+E) d. O(V * V)

**Answer: d**

- What is the time complexity of depth-first traversal for a graph using an adjacency list representation? a. O(V) b. O(E) c. O(V+E) d. O(V * V)

**Answer: c**

- What is the time complexity of depth-first traversal for a graph using an adjacency matrix representation? a. O(V) b. O(E) c. O(V+E) d. O(V * V)

**Answer: d**

- What is Dijkstra’s shortest path algorithm used for? a. Finding the longest path in a graph. b. Finding the shortest path in a directed acyclic graph. c. Finding the shortest path in a weighted graph. d. Finding the longest path in a directed acyclic graph.

**Answer: c**

- What is the time complexity of Dijkstra’s shortest path algorithm using an adjacency matrix representation? a. O(V log V) b. O(E log V) c. O(V^2) d. O(E^2)

**Answer: c**

- What is the time complexity of Dijkstra’s shortest path algorithm using an adjacency list representation? a. O(V log V) b. O(E log V) c. O(V^2) d. O(E^2)

**Answer: b**

__ Similar posts:-__

- C-programming MCQs part-1
- C-programming MCQs part-2
- C-programming MCQs part-3
- C-programming MCQs part-4
- C-programming MCQs part-5
- C-programming MCQs part-6
- COA MCQs part-1
- COA MCQs part-2
- COA MCQs part-3
- COA MCQs part-4

__Must check this :-__

__Must check this :-__

- Microprocessor 8085 MCQs part-1
- Microprocessor 8085 MCQs part-2
- Microprocessor 8085 MCQs part-3
- CSS MCQs part-1
- CSS MCQs part-2
- CSS MCQs part-3
- CSS MCQs part-4
- CSS MCQs part-5
- Engineering Mathematics -II MCQs part-1
- Engineering Mathematics -II MCQs part-2
- Engineering Mathematics -II MCQs part-3
- Engineering Mathematics -II MCQs part-4
- Engineering Mathematics -II MCQs part-5
- Operating system MCQs part-1
- Operating system MCQs part-2
- Operating system MCQs part-3
- Operating system MCQs part-4
- Operating system MCQs part-5

## 0 Comments