15.5 Sorted Sets and Navigable Sets Before reading this subsection, it is a good idea to review the Comparable<E> interface…