package Sorting; import java.util.*; public class SelectionSorting { //Time Complexity of Selection Sort = O(n^2) public static void main(String[] args) { Scanner sc = new Scanner(System.in); System.out.print("Enter the Size of the Array: "); int size = sc.nextInt(); int array[] = new int[size]; //for input System.out.print("Enter the array element: "); for(int i=0; i array[j]){ smallest = j; } } // swap the element int temp = array[smallest]; array[smallest] = array[i]; array[i] = temp; } for(int i=0; i