08.06.2015 Views

A Simple and Efficient Union-Find-Delete Algorithm - Corelab

A Simple and Efficient Union-Find-Delete Algorithm - Corelab

A Simple and Efficient Union-Find-Delete Algorithm - Corelab

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

The classic data structure<br />

Represent each set A as rooted tree T A<br />

<strong>Union</strong> links the root of the shallower tree to the<br />

root of the taller tree (by rank)<br />

Rank 1<br />

0<br />

9<br />

1<br />

Rank 0<br />

5 3 6<br />

Rank 0 Rank 0 Rank 0<br />

7<br />

Rank 2

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!