// insertion sort algorithm implemented in java
public class InsertionSort {
/*
this function takes an array and assumes the first index as sorted part
takes element from unsorted part and add to sorted part at appropiate position untill array is not sorted
*/
public void sort(int[] arr)
{
int size=arr.length;
for (int i=1;i