The document describes a Java program that implements insertion sort to sort an array of integers. The program defines an array with initial unsorted data, then uses a for loop with nested for loops to iterate through the array, insert each element into its sorted position, and print the sorted array after each iteration. It outputs the sorted array after each pass with the iteration number to show the progress of the algorithm.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
53 views
Program Java Insertion Sort
The document describes a Java program that implements insertion sort to sort an array of integers. The program defines an array with initial unsorted data, then uses a for loop with nested for loops to iterate through the array, insert each element into its sorted position, and print the sorted array after each iteration. It outputs the sorted array after each pass with the iteration number to show the progress of the algorithm.