public static void Main()
Random rand = new Random();
int[] testArray = new int[10];
for (int i = 0; i < rand; i++)
testArray[i] = rand.Next(10);
for (int i = 0; i < testArray.Length; i++)
Console.WriteLine(testArray[i]);
public static void PrintState(int[] input)
for (int i = 0; i < input.Length; i++)
Console.WriteLine(new string('#', input[i]));
public static void BubbleSort<T>(T[] input)
for (int i = 0; i < input.Length - 1; i++)
for (int j = 0; j < input.Length - i - 1; j++)
ref T current = ref input[j];
ref T next = ref input[j + 1];
if (current.CompareTo(next) == 1)
Swap(ref current, ref next);
public static void Swap<T>(ref T x, ref T y)