Advertisement
Dimitar182

merge main

Dec 18th, 2020
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. package merge;
  2. import java.util.Arrays;
  3. import java.util.Scanner;
  4. public class homwork3 {
  5.  
  6. public static void main(String[] args) {
  7. Scanner scan = new Scanner(System.in);
  8. System.out.println("Input numbers of elements: ");
  9. //int N = scan.nextInt();
  10. int N = Integer.parseInt(scan.nextLine());
  11. int[] ARR = new int[N];
  12. for(int i = 0; i < N; i++) {
  13. System.out.println("Input elements : " + i);
  14. ARR[i] = Integer.parseInt(scan.nextLine());
  15. }
  16.  
  17. System.out.println("BEGORE SORT : " + Arrays.toString(ARR) );
  18. MergeSort_methods.Divide(ARR, 0, ARR.length-1);
  19. System.out.println("AFTER SORT : " + Arrays.toString(ARR) );
  20. }
  21. }
  22.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement