diff --git a/selectionSort.java b/selectionSort.java new file mode 100644 index 0000000..4d6efbf --- /dev/null +++ b/selectionSort.java @@ -0,0 +1,43 @@ +public class selectionSort +{ + public static void main(String[] args) { + selectionSort obj = new selectionSort(); + + int a[] = {4, 2, -12, 22, 11}; + + obj.sort(a); + System.out.println("Sorted Array"); + obj.printArray(a); + } + + void sort(int a[]) + { + for(int i=0; i