MCPcopy Create free account
hub / github.com/Rishabh062/Hacktoberfest2021 / main

Method main

Java/SelectionSort.java:4–26  ·  view source on GitHub ↗
(String args[])

Source from the content-addressed store, hash-verified

2class selectionSort
3{
4 public static void main(String args[])
5 {
6 int arr[] = {2,3,1,5,4};
7
8 for(int i = 0; i < arr.length-1; i++)
9 {
10 int d = i;
11 for(int j = i+1; j < arr.length; j++)
12 {
13 if(arr[j] < arr[d])
14 {
15 d = j;
16 }
17 }
18 int t = arr[i];
19 arr[i] = arr[d];
20 arr[d] = t;
21 }
22 for(int i = 0; i < arr.length; i++)
23 {
24 System.out.print(arr[i]+" ");
25 }
26 }
27}

Callers

nothing calls this directly

Calls 1

printMethod · 0.80

Tested by

no test coverage detected