Created
July 27, 2019 23:33
-
-
Save sjehutch/c7288704c36bd0faf785e667f9f78194 to your computer and use it in GitHub Desktop.
Sorted Arrary Extention
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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