Sort methods in java
public class Sorts { /** * @author Alihan98ersoy * 01.07.2017(month,day,year) * Contents: * Selection Sort * İnsertion Sort * Shell Sort * Quick Sort */ // Selection sort //Find smallest number in second for replace it with first for integer i. public void Selectionsort(int[]list){ for(int i=0;i<list.length;i++){ int indexofsmallestnumber=i; for(int j=i+1;j<list.length;j++){ if(list[j]<list[indexofsmallestnumber]) {indexofsmallestnumber=j;} } int basket=list[indexofsmallestnumber];//basket for replace list[indexofsmallestnumber]=list[i]; list[i]=basket; } } /* İnsertion sort *İnsertion is good for small elements only because it requires more time for sorting a large number of elements. *Find the smallest number and put it correct place with comparing it every to until finding the correct place. *insertionSort works pretty well for partially sor...