I am currently working on making my own Generic Bubble Sorting which can easily sort Strings, int. Below is my Code for Normal Bubble Sorting.Can you help me out how to create a generic Method Of this?
public static void BubbleSorting()
{
int Swap;
for (int outer = Length; outer >= 1; outer--)
{
for (int inner = 0; inner < outer - 1; inner++)
{
if (array[inner] > array[inner + 1])
{
Swap = array[inner];
array[inner] = array[inner + 1];
array[inner + 1] = Swap;
}
}
Console.WriteLine();
Display();
}
}