I prefer to remove the tail recursion and have a while loop take care of the case where i < hi as such:
[html]private static void quicks(int [] arr, int lo, int hi)
{
int i;
do
{
i = lo;
int j = hi;
int pivot = arr[(lo + hi) / 2];
do
{
while (arr[i] < pivot)
{
i++;
}
while (arr[j] > pivot)
{
j--;
}
if (i <= j)
{
int temp = arr[i];
arr[i] = arr[j];
arr[j] = temp;
i++;
j--;
}
} while (i <= j);
if (lo < j)
{
quicks(arr, lo, j);
}
lo = i;
} while (i < hi);
}[/html]
now, unless you have a massively huge array (say, 2^20 or thereabouts), you shouldn't have any recursive stack overflow issues.