We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 464c990 commit e6533bcCopy full SHA for e6533bc
1 file changed
Basic Codes/sort.java
@@ -1,7 +1,7 @@
1
// Sir this is merge sort time complexity to sort is O(nlogn)
2
3
import java.util.*;
4
-class MergeSort
+class Main
5
{
6
void merge(int arr[], int l, int m, int r)
7
@@ -63,12 +63,12 @@ public static void main(String args[])
63
System.out.print("Enter ten numbers for the array");
64
for(int i=0; i<10; i++)
65
66
- array[i]=sc.nextInt();
+ arr[i]=sc.nextInt();
67
}
68
System.out.println("Given Array");
69
printArray(arr);
70
71
- MergeSort ob = new MergeSort();
+ Main ob = new Main();
72
ob.sort(arr, 0, arr.length - 1);
73
74
System.out.println("\nSorted array");
0 commit comments