Anybody pls tel me......How to write this sorting algorithm in c# to see the output....
// array of integers to hold values
private int[] a = new int[10] {1,3,67,89,23,45,90,7,34,56};
// number of elements in array
private int x;
// Quick Sort Algorithm
public void sortArray()
{
q_sort( 0, x-1 );
}
public void q_sort( int left, int right )
{
int pivot, l_hold, r_hold;
l_hold = left;
r_hold = right;
pivot = a[left];
while( left < right )
{
while( (a[right] >= pivot) && (left < right) )
{
right--;
}
if( left != right )
{
a[left] = a[right];
left++;
}
while( (a[left] <= pivot) && (left < right) )
{
left++;
}
if( left != right )
{
a[right] = a[left];
right--;
}
}
a[left] = pivot;
pivot = left;
left = l_hold;
right = r_hold;
if( left < pivot )
{
q_sort( left, pivot-1 );
}
if( right > pivot )
{
q_sort( pivot+1, right );
}
}
Pls tel me????