Implement the C code in the table in MIPS assembly.

￼

￼

#define N 30

int a[N] = {

24, 14, 7, 8, 15, 11,

29, 18, 19, 3, 22, 28,

16, 17, 25, 23, 13, 30,

4, 9, 20, 10, 27, 5,

12, 1, 26, 6, 21, 2

};

void quicksort(int a[],int l,int h)

{

if (l>=h)

return;

int j, i, key;

i=l;

j=h;

key=a[i];

while(i<j)

{

while (i<j && a[j]>key)

j--; if (i<j)

a[i++] = a[j];

while (i<j && a[i]<key)

i++; if (i<j)

a[j--] = a[i];

}

a[i] = key;

if (l < i-1)

quicksort(a, l, i-1);

￼

￼

￼

￼

if (i+1 < h)

quicksort(a, i+1, h);

}

int main() {

quicksort(a, 0, N-1);

return 0;

}

￼

￼-Reference:

http://en.wikipedia.org/wiki/Quicksort