CSE 326: Data Structures Lecture #17 The Dynamic (Equivalence) Duo: Weighted Union & Path Compression

2/17/00


Click here to start


Table of Contents

CSE 326: Data Structures Lecture #17 The Dynamic (Equivalence) Duo: Weighted Union & Path Compression

Today’s Outline

Hash Table Summary

What’s a Good Maze?

The Maze Construction Problem

The Middle of the Maze

Maze Construction Algorithm

Equivalence Relations

Disjoint Set Union/Find ADT

Disjoint Set Union/Find† More Formally

Example

Example, First Step

Example, Continued

Up-Tree Intuition

Up-Tree Union-Find Data Structure

Find

Union

The Whole Example (1/11)

The Whole Example (2/11)

The Whole Example (3/11)

The Whole Example (4/11)

The Whole Example (5/11)

The Whole Example (6/11)

The Whole Example (7/11)

The Whole Example (8/11)

The Whole Example (9/11)

The Whole Example (10/11)

The Whole Example (11/11)

Nifty storage trick

Implementation

Room for Improvement: Weighted Union

Weighted Union Code

Weighted Union Find Analysis

Room for Improvement: Path Compression

Path Compression Example

Path Compression Code

Digression: Doping at the Silicon Downs

Complex Complexity of Weighted Union + Path Compression

To Do

Coming Up

Author: Steve Wolfman

Email: owner-cse326@cs.washington.edu

Home Page: http://www.cs.washington.edu/326/

Download presentation source