Skip to content

Glossary: Coding Interviews in Go

Sort first

Also written: pattern 2

Sorting the input so items that belong together become neighbors. It costs O(n log n) and helps with 'closest' and 'group together' problems.

Where the book teaches it

Related terms

slices.SortFuncTwo pointers