Horje
bubble sort in c# Code Example
bubble sort in c#
public static void Sort<T>(T[] array) where T : IComparable 
{
    for (int i = 0; i < array.Length; i++)
    {
        for (int j = 0; j < array.Length - 1; j++) 
        {
            if (array[j].CompareTo(array[j + 1]) > 0) 
            {
            	Swap(array, j, j + 1); 
            } 
        }
    }
}
private static void Swap<T>(T[] array, int first, int second) 
{
	T temp = array[first];
  	array[first] = array[second];
  	array[second] = temp;
}




Csharp

Related
c# for statement Code Example c# for statement Code Example
stop program event in unity code Code Example stop program event in unity code Code Example
search the third word in string in c# Code Example search the third word in string in c# Code Example
add dynamically buttons in loop with events winform c# Code Example add dynamically buttons in loop with events winform c# Code Example
unity string array Code Example unity string array Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
9