Prog 4
Prog 4
QUICK SORT
import java.util.Scanner;
import java.math.*;
class quickSort
{
public static void quickSort(int[] arr, int low, int high)
{
if (low < high)
{
// Find the partition index
int pi = partition(arr, low, high);
OUTPUT:
Enter the value of n:
5
The Starttime: 1726396201972 Milliseconds
The endtime: 1726396201972 milliseconds
The sorted array is:
1653 2186 3155 3737 3851
The time taken to sort is: 0 milliseconds