Skip to content
This repository was archived by the owner on May 18, 2020. It is now read-only.

Latest commit

 

History

History
23 lines (12 loc) · 429 Bytes

File metadata and controls

23 lines (12 loc) · 429 Bytes

Mergesort

Mergesort rearranges N items into ascending order.

Implementation

MergeSort Class

Operation Description Complexity
void sort(Comparable[] a) Sort the items array N log N

MergeSort approach

  • divide array into two halves
  • recursively sort each half
  • merge two halves