Comparables and Comparators
In Java, there are two important interfaces, comparable and comparator.
# Comparable
A
comparable is an interface with a generic. A class implementing it must also implement the compareTo
function.
# Comparator
Comparators are classes that compare two objects.