no one is able to explain!

http://cboard.cprogramming.com/c-pro...tml#post945120

I started my discussion in the above link, while copy and pasting the Quicksort Algorithm from "The C Programming Language, Second Edition" by Brian W. Kernighan and Dennis M. Ritchie (page 87).

And I rised a simple question, e.g. if we have these inputs: e.g. {11, 3, 9, 7, 4)

How this algorithm will work (just one iteration)! Believe me or not, no one was able to explain it :(

TERRIFYING! And I still have problem to understand it... well I am novice, dummy etc. But what about others?

Code:

`/* qsort: sort v[left]...v[right] into increasing order */`

void qsort(int v[], int left, int right)

{

int i, last;

void swap(int v[], int i, int j);

if (left >= right) /* do nothing if array contains */

return; /* fewer than two elements */

swap(v, left, (left + right)/2); /* move partition elem */

last = left; /* to v[0] */

for (i = left + 1; i <= right; i++) /* partition */

if (v[i] < v[left])

swap(v, ++last, i);

swap(v, left, last); /* restore partition elem */

qsort(v, left, last-1);

qsort(v, last+1, right);

}

/* swap: interchange v[i] and v[j] */

void swap(int v[], int i, int j)

{

int temp;

temp = v[i];

v[i] = v[j];

v[j] = temp;

}