Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package QuickSort_183_02;
- import java.util.Arrays;
- import java.util.Scanner;
- import static QuickSort_183_02.QuickSort_Method.*;
- public class QuickSort_Main {
- public static void main(String[] args) {
- Scanner scan = new Scanner(System.in);
- int N = scan.nextInt(); //number of elements
- // int N = Integer.parseInt(scan.nextLine()); // same as above
- int [] arr = new int[N];
- //for cycle to fill up the array
- for (int i = 0; i < N; i++) {
- System.out.printf("Please,input the [%d] element : " , i);
- arr[i] = scan.nextInt();
- }
- //before sorting
- System.out.println("BEFORE SORTING : " + Arrays.toString(arr));
- // Call QuickSort
- QuickSort(arr, 0, N - 1);
- // after sorting
- System.out.println("AFTER SORTING : " + Arrays.toString(arr));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement