Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.company;
- import java.util.Arrays;
- import java.util.Scanner;
- import static com.company.QuickSortMethods.QuickSort;
- public class QuickSortMain {
- public static void main(String[] args) {
- Scanner scan = new Scanner(System.in);
- System.out.print("Input the number of elements /N/ : ");
- int N = Integer.parseInt(scan.nextLine());
- int[] ARR = new int[N];
- for (int i = 0; i <N ; i++) {
- System.out.printf("Input [%d] element of the array: ",i);
- ARR[i] = Integer.parseInt(scan.nextLine());
- }
- System.out.println("Before: " + Arrays.toString(ARR));
- QuickSort(ARR,0,N-1);
- System.out.println("After: "+ Arrays.toString(ARR));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement