Introduction to Algorithms, Second Edition

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

View Full Document Right Arrow Icon
The University of Texas at Austin Lecture 17 Department of Computer Sciences Professor Vijaya Ramachandran Disjoint Sets Data Structure CS357: ALGORITHMS, Spring 2006 A disjoint-sets data structure maintains a collection of S = { S 1 , S 2 , · · · , S k } of disjoint sets, i.e., S i S j = φ if i n = j . Each set in S is identiFed by a representative (or ‘rep’), which is an element in the set. The following operations are supported: Make-set ( x ). creates a new one-element set { x } whose representative is x . (±or correctness it is required that element x is not already present in another set in the collection. Union ( x, y ). Here, x and y are elements in the current collection of sets. This operation creates the set S T , thereby removing S and T from S . Find-set ( x ). Given a pointer to an element x in the collection, returns a pointer to the representative of the set containing x . We will assume that we start with the initially empty collection. We will analyze the running time of a data structure in terms of n , the number of Make-set operations (which is also the number of elements in the collection), and m , the total number of Make-set, Union and Find-set operations executed.
Background image of page 1

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

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 01/30/2008 for the course CS 357 taught by Professor Ramachandran during the Spring '06 term at University of Texas.

Page1 / 3

Lecture 17 - The University of Texas at Austin Department...

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

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