## Computer Science 226 Algorithms and Data Structures Spring 2013

Course Information | Assignments | Exercises | Lectures | Exams | Precepts | Booksite

## Minimum Spanning Tree

### Things to Know Before Lecture

• Know the Basic Concepts and Definitions.
1. Definition of an Edge Weighted Undirected Graph.
2. API for Edge class (either, other, compareTo).
3. Definition of a minimum spanning tree.
4. Definition of a cut (there are 2^(V-1)-1 cuts).
• Understand how to manually carry out the steps of the two basic MST finding algorithms.
1. Kruskal's algorithm (repeatedly add smallest edge weight from the whole graph).
2. Prim's algorithm (repeatedly add smallest edge weight from the MST-under-construction).
It's not necessary to know why the two MST algorithms work, since we'll be going through this during class. You should arrive knowing how the algorithms work. Nor is it necessary to know how to implement Kruskal's algorithm and Prim's algorithm such that you can actually run them on a computer (just being able to do them by hand with pencil and paper is good enough).

### Pre-Lecture Preparation Guide.

High priority videos are in red. Medium priority videos are in green. Low priority videos are in blue.

TOPIC COURSERA BOOK SLIDES DEMO
MST Basics 0m - 4m
604-605
1-11
Greedy Algorithm 0m - 13m
606-607 13-20 Demo
Kruskal's Algorithm 0m - 4m
4m - 12m
624-646
627
31-32
33-38
Demo
Edge-Weighted Graph API 0m - 11m
608-612 23-29
Prim's Algorithm 0m - 3m 20s
3m 20 - 26m
616
617-619
41-42
43-53
Demo

Checkpoint 1: Make sure you can follow all 3 demos.

Checkpoint 2: Complete the Blackboard exercises (they're quite easy).