12.07.2015 Views

Heap sort and complexity, Disjoint Union & Find, Complexity ...

Heap sort and complexity, Disjoint Union & Find, Complexity ...

Heap sort and complexity, Disjoint Union & Find, Complexity ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 2: Elementary Data Structures<strong>Union</strong>: Make one of the trees a subtree of the other127 8 9 251105 107 8 9In order to find <strong>Union</strong> of two sets all one has to do is, set theparent field of the root to the other root. We identify the setsby the index of roots.

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

Saved successfully!

Ooh no, something went wrong!