Skip to content

Glossary: Coding Interviews

Sort first

Also written: sorted, sorted(items, key=…)

A pattern: sort the data so related items sit next to each other, which costs O(n log n). Python's `sorted` returns a new sorted copy and accepts a `key=` function.

Where the book teaches it

Related terms

LambdaInterval