Quick
Quick
h>
int partition(int arr[], int low, int high) //Partitions the array and returns
pivot
{
int pivot = arr[high];
int i = low - 1;
int main()
{
int n;
printf("Enter the size of the array: ");
scanf("%d", &n);
int arr[n];
printf("Enter elements of the array: ");
for (int i = 0; i < n; i++)
{
scanf("%d", &arr[i]);
}
quicksort(arr, 0, n - 1);
printf("Quick Sort\n");
printf("Sorted array: ");
for (int i = 0; i < n; i++)
{
printf("%d ", arr[i]);
}
return 0;
}