public static void Main()
int[] a = {1, -3, 5, 7, -9, 0, 2, -4, 6, 8, 0};
public static void partitioning(int[] a, int mid)
while (s + m + b != a.Length)
swap(ref a[s + m], ref a[s]);
swap(ref a[s + m], ref a[a.Length - 1 - b]);
public static void printArray(int[] a)
for(int i = 0; i <a.Length; ++i)
Console.Write(" " + a[i]);
public static void swap(ref int a, ref int b)