Skip to content
START WITH A QUESTION

What would you like to understand?

Find an answer. See the moment it becomes clear. Follow the idea further.

← Concept directory

Answers for “Prim 算法的时间复杂度是多少?”

1 keyword matches

Understanding your question. You can explore the search results below now.

Understand why

↗

Edge B-E is skipped because both of its endpoints (B and E) are already in the visited set (MST). Prim's algorithm only considers edges that connect a visited vertex to an unvisited vertex to avoid creating cycles.

Conditions: Both endpoints of the edge are already marked as visited.; The algorithm strictly follows the rule of adding only crossing edges.