/NameSorter

A Java 7 program to sort names by last name using Bubble Sort

Primary LanguageJava

Name Sorter🧾

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.

🚀 How to Use

  1. Clone or download the repository to your local machine.
  2. Ensure you have Java Development Kit (JDK) installed.
  3. Open the project in your favorite Java IDE or text editor.

💡 Sorting Algorithm: Bubble Sort

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.

📋 Example

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

☕️ Java Version

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.

🤝 Contribution

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!