Skip to content

Glossary: Data Structures and Algorithms in Java

comparator

Also written: Comparator, comparators

An object, often written as a lambda or method reference, that says which of two items goes first. You pass it to sort methods or to a `PriorityQueue`.

Where the book teaches it

Related terms

lambdamethod referencethenComparingPriorityQueue