liveBook · Manning

Merge sort

Merge sort is a comparison-based sorting algorithm that recursively divides a sequence and merges the resulting sorted subsequences.

How 2 Manning books explain it

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

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.