Recall & Review
beginner
What is a Minimum Spanning Tree (MST)?
A Minimum Spanning Tree is a subset of edges in a connected, weighted graph that connects all vertices together without any cycles and with the minimum possible total edge weight.
Click to reveal answer
beginner
What is the main idea behind Prim's algorithm?
Prim's algorithm builds the MST by starting from any vertex and repeatedly adding the smallest edge that connects a vertex in the tree to a vertex outside the tree until all vertices are included.
Click to reveal answer
beginner
How does Prim's algorithm choose the next edge to add?
It selects the edge with the smallest weight that connects a vertex already in the MST to a vertex not yet included.
Click to reveal answer
intermediate
Why does Prim's algorithm always produce a minimum spanning tree?
Because it always picks the smallest possible edge that expands the tree without creating cycles, ensuring the total weight is minimized.
Click to reveal answer
intermediate
What data structure is commonly used to efficiently implement Prim's algorithm?
A priority queue (or min-heap) is used to quickly select the edge with the smallest weight at each step.
Click to reveal answer
What does Prim's algorithm start with?
✗ Incorrect
Prim's algorithm begins from any single vertex and grows the MST by adding edges.
Which of the following best describes the edge selection in Prim's algorithm?
✗ Incorrect
Prim's algorithm always picks the smallest edge that connects the current MST to a new vertex.
What type of graph is required for Prim's algorithm to work correctly?
✗ Incorrect
Prim's algorithm requires a connected weighted graph to find a minimum spanning tree.
What is the main goal of Prim's algorithm?
✗ Incorrect
Prim's algorithm is designed to find a minimum spanning tree.
Which data structure helps Prim's algorithm efficiently pick the next edge?
✗ Incorrect
A priority queue or min-heap allows quick access to the smallest edge.
Explain how Prim's algorithm builds a minimum spanning tree step-by-step.
Think about growing the tree one edge at a time.
You got /4 concepts.
Why is a priority queue useful in Prim's algorithm?
Consider how to find the minimum edge fast.
You got /3 concepts.