Algorithms
Home ] Up ] What is It? ] Vector & Enumeration ] Collections Interfaces ] [ Algorithms ] Sets ] Maps ]

 

Comparable Interface
Comparator Interface
Collections Class
Comparable Example
Comparator Example
General Applicability

 

As mentioned earlier, a collections framework provides interfaces, implementations and algorithms.

An example of an algorithm is a sort.   Sorting algorithms have been the subject of an immense amount of research in computer science over the years.  You most likely have already studied several sort algorithms in a Data Structures and Algorithms class.

By its very nature, a sort can only be applied to a collection that has a defined ordering.  That is, one element of the collection can be compared against another element to determine which order to place them in.  There are two interfaces which support such comparisons:  Comparable and Comparator.

 

This page was last modified on 02 October, 2007