Header Ads Widget

Algorithm multiple choice questions part-5

 Graph MCQs Questions:-

  1. 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

  1. 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

  1. 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

  1. 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

  1. 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

  1. 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

  1. 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

  1. 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

  1. 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

  1. 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

  1. 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

  1. 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


  Pre  ðŸ‘ˆ                                👉  Next  

 Similar posts:-

  1. C-programming MCQs part-1
  2. C-programming MCQs part-2
  3. C-programming MCQs part-3
  4. C-programming MCQs part-4
  5. C-programming MCQs part-5
  6. C-programming MCQs part-6
  7. COA MCQs part-1
  8. COA MCQs part-2
  9. COA MCQs part-3
  10. COA MCQs part-4

EasyCodingZone


Must check this :-

  1. Microprocessor 8085 MCQs part-1
  2. Microprocessor 8085 MCQs part-2
  3. Microprocessor 8085 MCQs part-3
  4. CSS MCQs part-1
  5. CSS MCQs part-2
  6. CSS MCQs part-3
  7. CSS MCQs part-4
  8. CSS MCQs part-5
  9. Engineering Mathematics -II MCQs part-1
  10. Engineering Mathematics -II MCQs part-2
  11. Engineering Mathematics -II MCQs part-3
  12. Engineering Mathematics -II MCQs part-4
  13. Engineering Mathematics -II MCQs part-5
  14. Operating system MCQs part-1
  15. Operating system MCQs part-2
  16. Operating system MCQs part-3
  17. Operating system MCQs part-4
  18. Operating system MCQs part-5



Post a Comment

0 Comments