0
0
DSA Typescriptprogramming~5 mins

Minimum Spanning Tree Kruskal's Algorithm in DSA Typescript - 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 doesn't create a cycle, repeating until all vertices are connected.
Click to reveal answer
intermediate
Why do we use a Union-Find (Disjoint Set) data structure in Kruskal's Algorithm?
Union-Find helps efficiently check if adding an edge creates a cycle by tracking which vertices are in the same connected component, allowing quick union and find operations.
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 edges. Union-Find operations are almost constant time.
Click to reveal answer
beginner
In Kruskal's Algorithm, what happens if adding an edge creates a cycle?
If adding an edge creates a cycle, the edge is skipped and not added to the MST to keep the tree structure without loops.
Click to reveal answer
What is the first step in Kruskal's Algorithm?
ASort all edges by their weight
BPick any vertex as the starting point
CCreate adjacency list
DRemove all cycles from the graph
Which data structure is commonly used to detect cycles in Kruskal's Algorithm?
AStack
BUnion-Find (Disjoint Set)
CQueue
DBinary Search Tree
What does Kruskal's Algorithm produce at the end?
AA shortest path tree
BA maximum spanning tree
CA cycle graph
DA minimum spanning tree
If an edge connects two vertices already in the same set, what should Kruskal's Algorithm do?
ASkip the edge to avoid cycle
BAdd the edge to MST
CRemove one vertex
DRestart the algorithm
What is the main reason sorting edges is important in Kruskal's Algorithm?
ATo find the longest path
BTo build adjacency matrix
CTo ensure the MST has minimum total weight
DTo detect cycles faster
Explain how Kruskal's Algorithm builds a Minimum Spanning Tree step-by-step.
Think about sorting edges and checking cycles before adding.
You got /5 concepts.
    Describe the role of the Union-Find data structure in Kruskal's Algorithm and why it is important.
    Focus on cycle detection and grouping vertices.
    You got /5 concepts.