This repository contains a simple Java program that sorts a list of names based on the last name. The program uses Java 7 and demonstrates a custom sorting algorithm, specifically the Bubble Sort, to arrange the names in ascending order by their last names.
- Clone or download the repository to your local machine.
- Ensure you have Java Development Kit (JDK) installed.
- Open the project in your favorite Java IDE or text editor.
The program employs the Bubble Sort algorithm to sort the names based on the last name. Bubble Sort is a straightforward comparison-based sorting algorithm that repeatedly steps through the list to be sorted, compares adjacent elements, and swaps them if they are in the wrong order. The pass through the list is repeated until the list is sorted.
Suppose you have the following list of names:
Hugh Miliation
Christian Mingle
Juan Soponatime
Dante Sinferno
Orson Milka Iddins
Pat Agonia
Erna Dorey Battelle
Running the program will sort the names based on the last name:
Pat Agonia
Erna Dorey Battelle
Orson Milka Iddins
Hugh Miliation
Christian Mingle
Dante Sinferno
Juan Soponatime
The program is written in Java 7 and does not use any Java 8 features. It provides a simple and straightforward implementation of the name sorting functionality using the Bubble Sort algorithm.
Feel free to explore the code and modify it as needed. If you find any issues or have suggestions for improvement, please feel welcome to create an issue or submit a pull request.
Happy sorting!