{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

CS223-0226-DisjointSet

# CS223-0226-DisjointSet - Disjoint Set Neil Tang CS223...

This preview shows pages 1–5. Sign up to view the full content.

CS223 Advanced Data Structures and Algorithms 1 Disjoint Set Disjoint Set Neil Tang Neil Tang 02/26/2008 02/26/2008

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
CS223 Advanced Data Structures and Algorithms 2 Class Overview Class Overview Disjoint Set and An Application Basic Operations Linked-list Implementation Array Implementation Union-by-Size and Union-by-Height(Rank) Find with Path Compression Worst-Case Time Complexity
CS223 Advanced Data Structures and Algorithms 3 Disjoint Set Disjoint Set Given a set of elements, we can have a collection S = {S 1 , S 2 , ... S k } of disjoint dynamic (sub) sets. Representative of a set: We choose one element of a set to identify the set, e.g., we use the root of a tree to identify a tree, or the head element of a linked list to access the linked list. Usually, we want to find out if two elements belong to the same set.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
CS223 Advanced Data Structures and Algorithms 4 An Application An Application Given an undirected graph G = (V, E) We may want to find all connected components, whether the graph is connected or whether two given nodes belong to the same connected component.
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 20

CS223-0226-DisjointSet - Disjoint Set Neil Tang CS223...

This preview shows document pages 1 - 5. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online