Presentation is loading. Please wait.

Presentation is loading. Please wait.

Mergesort.

Similar presentations


Presentation on theme: "Mergesort."— Presentation transcript:

1 Mergesort

2 Bottom up vs top down Typical mergesort (top-down) Traversal:
Post-order The top levels are a power of 2

3 Bottom up vs top down Bottom-up mergesort Traversal: level-order
All inputs apart from the final one are a power of 2

4 Bottom up vs top down Bottom up: creates sorted sub-inputs
Top down: sorts half input and proceeds to the other half Bottom up / top down

5 Bottom up with various input types
Random, small range, almost sorted, almost reversely sorted, many duplicates Time to execute: independent of input type, depends only on input size


Download ppt "Mergesort."

Similar presentations


Ads by Google