I am sorry to tell you, but the segmentation fault probably comes from the many, many errors in your code. I got a stack overflow when I tried the code, but let's go through it.
Your main procedure is okay, but should look more like this:
int a[MAX], n, i; clock_t end, start;
The quick_sort procedure is okay and seriously, I don't want to sound cocky or something, but the partition function is kinda messed up. Let's see:
int partition(int a,int low,int high)
while (i < j)
while (a[i] < key) ++i;
while (key < a[j]) --j;
if (i < j) temp = a[i], a[i] = a[j], a[j] = temp;
I suggest to analyze every state change when you develop an algorithm like this. I used a piece of paper for that and wrote down the variables used in loops for every iteration. This helps to find inconsistencies in your algorithms pretty quickly and often, you also get an idea on how to solve them that way, too.
I hope, I could help you with this.