O(n log n) linearithmic time
easy 16 minO(n log n) is linear work repeated a logarithmic number of times: n work on each of log n levels.
Where it shows up
The same pattern appears across everyday software.
Built-in sorting in every language
Python's sorted() and list.sort() use Timsort, a hybrid of merge sort and insertion sort that finds runs already in order. Java uses Timsort for objects and dual-pivot quick sort for primitives, and C++ std::sort uses introsort. All guarantee or average O(n log n).
Database ORDER BY and joins
When a query sorts more rows than fit in memory, the database sorts chunks that do fit, writes them out as runs, and merges the runs. This external merge sort is O(n log n) and reads the data in long sequential passes. Sort-merge joins use the same idea.
Big data shuffles
MapReduce and Spark sort the output of the map step by key so that all values for a key reach the same reducer. Sorting terabytes this way is a distributed merge sort.
Calendars and interval scheduling
Finding free slots, merging overlapping meetings or counting the rooms needed all start by sorting intervals by start time, O(n log n), followed by a single linear scan.
Priority queues in simulations
Event-driven simulations, Dijkstra's shortest paths and task schedulers push and pop n items on a binary heap, each in O(log n), for O(n log n) in total.
Audio, images and the FFT
The fast Fourier transform splits a signal into even and odd halves recursively, the same 2T(n/2) + O(n) shape as merge sort. It powers audio compression, image filters and fast multiplication of huge numbers.