We should throw an exception. Typically used to help with sorting. Does case-insensitive comparison. The two objects are initialized and can be converted to strings. Today we'll consider two others.
Selection sort is among the simpler and more natural methods for sorting.
In this sorting algorithm, you segment the array into two subparts, a sorted part and an unsorted part. You repeatedly find the largest of the unsorted elements, and swap it into the beginning of the sorted part. This continues until there are no unsorted elements. Here's my recursive version of selection sort. Initially, each element is null.