Match List I with List II List I List II A. Dijkstra's Algorithm I. Calculates…

2022

Match List I with List II

List I List II

A.  Dijkstra's Algorithm I. Calculates path matrix

B. Prim's Algorithm II. Stores minimum cost edge

C.  Warshall's Algorithm III. Stores the total cost from a source node to the current node

D. Kruskal's algorithm IV. Finds Minimum Spanning Tree

Choose the correct answer from the options given below:

  1. A.

    A-I, B-II, C-III, D-IV

  2. B.

    A-III, B-II, C-I, D-IV

  3. C.

    A-II, B-I, C-IV, D-III

  4. D.

    A-III, B-IV, C-II, D-I

Attempted by 92 students.

Show answer & explanation

Correct answer: B

Solution:

Match each algorithm from List I to its correct description from List II and brief justification:

  • Dijkstra's Algorithm → Stores the total cost from a source node to the current node. Dijkstra is a single-source shortest-path algorithm that maintains the best-known distance (total cost) from the source to every node.

  • Prim's Algorithm → Stores/chooses minimum cost edges to grow a spanning tree. Prim's builds an MST by repeatedly selecting the minimum-weight edge connecting the growing tree to a new vertex.

  • Warshall's Algorithm → Calculates a path matrix (transitive closure / reachability). Warshall's algorithm determines reachability information or path existence between all pairs of nodes, producing a path matrix.

  • Kruskal's Algorithm → Finds a Minimum Spanning Tree. Kruskal's constructs an MST by sorting edges by weight and adding the smallest edges that do not form cycles.

Therefore, the correct correspondences are:

  • Dijkstra's Algorithm matched with the description about storing total cost from a source node.

  • Prim's Algorithm matched with the description about selecting/storing minimum-cost edges to grow a tree.

  • Warshall's Algorithm matched with the description about calculating a path matrix.

  • Kruskal's Algorithm matched with the description about finding a Minimum Spanning Tree.

A video solution is available for this question — log in and enroll to watch it.

Explore the full course: Coding For Placement