diff --git a/SelectionSort.java b/SelectionSort.java new file mode 100644 index 0000000..d3b6400 --- /dev/null +++ b/SelectionSort.java @@ -0,0 +1,40 @@ +import java.util.Scanner; + +public class SelectionSort +{ + public static void main(String args[]) + { + int size, i, j, temp; + int arr[] = new int[50]; + Scanner scan = new Scanner(System.in); + + System.out.print("Enter Array Size : "); + size = scan.nextInt(); + + System.out.print("Enter Array Elements : "); + for(i=0; i arr[j]) + { + temp = arr[i]; + arr[i] = arr[j]; + arr[j] = temp; + } + } + } + + System.out.print("Now the Array after Sorting is :\n"); + for(i=0; i