Write a program to Sort a given set of n integer elements using Quick Sort method and compute its time complexity. Run the program for varied values of n> 5000 and record the time taken to sort.

#include<stdio.h>
#include<conio.h>
int partition(int a[],int low,int high){
	int pivot=a[low],temp;
	int i=low+1;
	int j=high;
	for(;;){
		while(i<high && a[i]<pivot){
			i++;
		}
		while(pivot<a[j]){
			j--;
		}
		if(i<j){
			temp=a[i];
			a[i]=a[j];
			a[j]=temp;
		}
		else{
			temp=a[low];
			a[low]=a[j];
			a[j]=temp;
			return j;
		}
	}
}
void quick_sort(int a[],int low,int high){
	if(low<=high){
		int pivot=partition(a,low,high);
		quick_sort(a,low,pivot-1);
		quick_sort(a,pivot+1,high);
	}
}
void main(){
	int n,a[10],i;
	clrscr();
	printf("Enter size of array\n");
	scanf("%d",&n);
	printf("Enter all array elements to sort\n");
	for(i=0;i<n;i++){
		scanf("%d",&a[i]);
	}
	quick_sort(a,0,n-1);
	printf("Sorted array are:\n");
	for(i=0;i<n;i++){
		printf("%d\n",a[i]);
	}
	getch();
}