Skip to content

Glossary: Coding Interviews in Java

Comparator

Also written: comparators, Comparator.comparingInt, thenComparing

A Java object or lambda that says which of two items sorts first. It is used to order heap entries, sort slots by start time, or order customers by count and then name.

Where the book teaches it

Related terms

Heap / PriorityQueue