CS223-0226-DisjointSet

CS223-0226-DisjointSet - Disjoint Set Neil Tang 02/26/2008...

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

View Full Document Right Arrow Icon
CS223 Advanced Data Structures and Algorithms 1 Disjoint Set Disjoint Set Neil Tang Neil Tang 02/26/2008 02/26/2008
Background image of page 1

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

View Full DocumentRight Arrow Icon
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
Background image of page 2
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.
Background image of page 3

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

View Full DocumentRight Arrow Icon
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
Background image of page 4
Image of page 5
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 04/17/2008 for the course CS 223 taught by Professor Tang during the Spring '07 term at MSU Bozeman.

Page1 / 20

CS223-0226-DisjointSet - Disjoint Set Neil Tang 02/26/2008...

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

View Full Document Right Arrow Icon
Ask a homework question - tutors are online