From 23f2e0bea04d8526db06cf7f1c0718a839324cf2 Mon Sep 17 00:00:00 2001 From: webdesignerrps <116552212+webdesignerrps@users.noreply.github.com> Date: Sat, 29 Oct 2022 20:22:44 +0530 Subject: [PATCH] Create selection --- Java/sorting techniques/selection | 50 +++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 Java/sorting techniques/selection diff --git a/Java/sorting techniques/selection b/Java/sorting techniques/selection new file mode 100644 index 00000000..8b099709 --- /dev/null +++ b/Java/sorting techniques/selection @@ -0,0 +1,50 @@ +import java.util.Scanner; + +public class SelectionSortExample2 +{ + 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