Sorting algorithms - Relocation Counter
Your quicksort has a bug
Your midpoint calculation can overflow for large arrays:
mid=(left+right)/2;

Consider the following example code (C++ but it applies to C as well):
int x = std::numeric_limits&lt;int&gt;::max()/2 + 1;
unsigned int y = (x + x)/2;
cout&lt;&lt;&quot;x:&quot;&lt;&lt;x&lt;&lt;&quot; y:&quot;&lt;&lt;y&lt;&lt;endl; // x:1073741824 y:3221225472

The correct way to calculate this is like this:
mid = left + (right - left)/2;

which will not overflow if right&gt;left for any right and left.