Skip to content

Glossary: Coding Interviews in C++

Comparator

Also written: comparator lambda, cmp

A function you pass to a sorting routine to say which of two items goes first, as in the top-customers tie rule (bigger count first, then name).

Where the book teaches it

Related terms

Lambdastd::sort and std::stable_sortstd::partial_sort