From 6398dfd0369c42da9db702fb84298722e6991da3 Mon Sep 17 00:00:00 2001 From: Madhura Date: Sun, 2 Oct 2022 16:46:53 +0530 Subject: [PATCH] add selection sort in java --- java/SelectionSort.java | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 java/SelectionSort.java diff --git a/java/SelectionSort.java b/java/SelectionSort.java new file mode 100644 index 0000000..baedddd --- /dev/null +++ b/java/SelectionSort.java @@ -0,0 +1,18 @@ + +public class SelectionSort { + public static void selectionSort(int[] array) { + for (int i = 0; i < array.length; i++) { + int minIndex=i; + for (int j = i+1; j < array.length; j++) { + if (array[j]