Skip to content

Glossary: Coding Interviews in JavaScript

Sort first

Pattern 2: sort the data so items that belong together become neighbors, for problems like 'closest' or 'group together'. It costs O(n log n).

Where the book teaches it

Related terms

ComparatorPattern