MergeSort Parallel Combiner
(Optional) Challenge Parallel Combiner
| class: | ParallelCombiner.java | |
| methods: | parallelCombine | |
| package: | sort.challenge.merge | |
| source folder: | student/src/main/java |
You can divide and conquer the combine step in merge sort. The work should remain Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle \mathcal{O}(n\lg{}n)} while the critical path length can be cleanly improved from Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle \mathcal{O}(n)} down to Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle \mathcal{O}(\lg^3{}n)} .
Sadly, you cannot simply divide both sides down the middle and merge the lower halves together and the upper halves together (as the data will likely not line up perfectly).
Useful methods:
- ArrayUtils.binarySearchForKeyOrInsertionPointOfKey(array, key, comparator)
- ArrayUtils.concat(a, b)
- ArrayUtils.split(array, index)
Parallel Combiner Correctness
| class: | _ParallelMergeSortParallelCombinerTestSuite.java | |
| package: | sort.challenge.merge | |
| source folder: | testing/src/test/java |