Merge sort
Merge sort is a comparison-based sorting algorithm that recursively divides a sequence and merges the resulting sorted subsequences.
Clojure: The Essential Reference
Merge sort is a comparison-sorting algorithm that recursively divides input into smaller portions and merges ordered portions back together.
- How it is used
- Handles large datasets by sorting bounded chunks externally and presenting their results as a lazy sequence.
- How deep it goes
- Explains chunk splitting, parallel processing, disk storage, and lazy merging, stopping short of lower-level algorithm analysis.
- Examples
- Uses IdRange, temporary files, parallel chunk processing, and a psort call returning the first ten values.
- What you can do after
- Build it from scratch with reducers, temporary files, chunk sorting, and a lazy multiway merge.
Read how Clojure: The Essential Reference explains merge sort →
100 Go Mistakes and How to Avoid Them
A comparison-sorting algorithm that recursively divides a collection and merges sorted subcollections.
- How it is used
- Uses merge sort to demonstrate why concurrency is not always faster.
- How deep it goes
- Explains recursive splitting, merging, goroutine coordination, benchmarking, and a workload-size cutoff.
- Examples
- Uses sequential and parallel Go implementations, benchmark results, and a 2,048-element cutoff.
- What you can do after
- Evaluate when parallelizing recursive work helps and apply a cutoff to reduce concurrency overhead.
Read how 100 Go Mistakes and How to Avoid Them explains merge sort →
Related concepts
- sorting algorithmkind of · A sorting algorithm is a procedure that rearranges elements of a collection into an order determined by an ordering criterion.
- O(n * log n)measured by · O(n log n) is an asymptotic growth rate in which computation increases proportionally to the input size multiplied by its logarithm.
- quicksortalternative to · Quicksort is a comparison-based sorting algorithm that partitions elements around a pivot and recursively sorts the resulting subranges.
- machine learningkind of · Machine learning is a field of computational methods in which systems learn patterns or relationships from data to make predictions, decisions, or other outputs.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.

