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 StructuresAs a result of the lemma, the maximum time to process a findis O(log n) if there are n elements in the tree.Sequence of nunions <strong>and</strong> m finds is bounded by O(m log n). Furtherimprovement is possible if we make use of collapsing rule.Collapsing rule: If j is the node on the path from i to its rootthen set PARENT(j) := ROOT(i).

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

Saved successfully!

Ooh no, something went wrong!