Find a method↗
To start Prim's algorithm, create an empty list called 'visited' to track touched nodes, then pick an arbitrary starting node and add it to the visited list.
Conditions: The graph is weighted and connected.; You have a mechanism to track visited vertices (e.g., a list or set).
0:12 – 0:34Watch this moment ↗
To start Prim's algorithm, create an empty list called 'visited' to track touched nodes, then pick an arbitrary starting node and add it to the visited list.
Conditions: The graph is weighted and connected.; You have a mechanism to track visited vertices (e.g., a list or set).
0:12 – 0:34Watch this moment ↗