- Insertion sort is the sorting mechanism where the sorted array is built having one item at a time. The array elements are compared with each other sequentially and then arranged simultaneously in some particular order. The analogy can be understood from the style we arrange a deck of cards. This sort works on the principle of inserting an element at a particular position, hence the name Insertion Sort.
- This java example shows how to sort an element of Java ArrayList using selection sort method of Collections class.
- The program firstly assign some values including person's atttributes to its object and performs sort process in terms of each attribute title. All sort process is implemented by Turkish alphabetical order.
- src
- insertionsort
- InsertionSortProcess.java
- main
- Main.java
- model
- Person.java
- util
- DefineValues.java
- ShowProcess.java
- insertionsort
| Files Names | Information |
|---|---|
| InsertionSortProcess.java | Implementing Insertion Sort Process by Turkish alphabetical order |
| Person.java | Defining it as a POJO |
| Main.java | Handle with all project files to run the program |
| ShowProcess.java | Showing all information about Person Object as output |
| DefineValues.java | Filling its attributes into Person Object |