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