Skip to content

Instantly share code, notes, and snippets.

@sjehutch
Created July 27, 2019 23:33
Show Gist options
  • Save sjehutch/c7288704c36bd0faf785e667f9f78194 to your computer and use it in GitHub Desktop.
Save sjehutch/c7288704c36bd0faf785e667f9f78194 to your computer and use it in GitHub Desktop.
Sorted Arrary Extention
using System;
public class Sort {
public static int[] SortArray(int[] array)
{
int length = array.Length;
int temp = array[0];
for (int i = 0; i < length; i++)
{
for (int j = i+1; j < length; j++)
{
if (array[i] > array[j])
{
temp = array[i];
array[i] = array[j];
array[j] = temp;
}
}
}
return array;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment