-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.java
More file actions
37 lines (29 loc) · 1.03 KB
/
Main.java
File metadata and controls
37 lines (29 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package sorting;
public class Main {
public static void main(String[] args) {
int arr[] = new int[]{2,8,4,1,5,3,6,9};
//Call for Insertion Sort
var inSort = new Sort();
int inSorted[] = inSort.insertionSort(arr);
System.out.print("Insertion Sort : ");
for(int i=0;i<inSorted.length;i++){
System.out.print(inSorted[i]+" ");
}
System.out.println();
//Call for Bubble Sort
var bubSort = new Sort();
int bubSorted[] = bubSort.bubbleSort(arr);
System.out.print("Bubble Sort : ");
for(int i=0;i<bubSorted.length;i++){
System.out.print(bubSorted[i]+" ");
}
System.out.println();
//Call for Selection Sort
var selSort = new Sort();
int selSorted[] = selSort.selectionSort(arr);
System.out.print("Selection Sort : ");
for(int i=0;i<selSorted.length;i++){
System.out.print(selSorted[i]+" ");
}
}
}