0
0
DSA Cprogramming~5 mins

Minimum Spanning Tree Kruskal's Algorithm in DSA C - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
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 Kruskal's Algorithm?
Kruskal's Algorithm builds the MST by sorting all edges by weight and adding the smallest edge to the MST if it does not form a cycle, repeating until all vertices are connected.
Click to reveal answer
intermediate
Why do we use a Disjoint Set (Union-Find) data structure in Kruskal's Algorithm?
The Disjoint Set helps efficiently check if adding an edge will create a cycle by tracking which vertices are in the same connected component.
Click to reveal answer
intermediate
What is the time complexity of Kruskal's Algorithm?
The time complexity is O(E log E), where E is the number of edges, mainly due to sorting the edges. Union-Find operations are almost constant time.
Click to reveal answer
beginner
In Kruskal's Algorithm, what happens if an edge connects two vertices already in the same set?
The edge is skipped to avoid creating a cycle in the MST.
Click to reveal answer
What is the first step in Kruskal's Algorithm?
ARemove all cycles
BPick any vertex as starting point
CCreate adjacency matrix
DSort all edges by weight
Which data structure is commonly used to detect cycles in Kruskal's Algorithm?
ADisjoint Set (Union-Find)
BQueue
CStack
DBinary Search Tree
What does Kruskal's Algorithm guarantee about the resulting tree?
AIt contains all edges of the graph
BIt has the maximum total edge weight
CIt connects all vertices with minimum total edge weight
DIt is a directed tree
If adding an edge creates a cycle, what does Kruskal's Algorithm do?
ASkips the edge
BAdds the edge anyway
CRemoves the cycle edges
DRestarts the algorithm
What is the main factor affecting Kruskal's Algorithm's running time?
ANumber of vertices
BNumber of edges and sorting them
CDepth of recursion
DSize of adjacency list
Explain step-by-step how Kruskal's Algorithm builds a Minimum Spanning Tree.
Think about sorting edges and using sets to avoid cycles.
You got /6 concepts.
    Describe how the Disjoint Set (Union-Find) data structure helps in Kruskal's Algorithm.
    Focus on cycle detection and set merging.
    You got /5 concepts.