Created
October 4, 2018 07:32
-
-
Save paulohenriquesn/1dab20e2d21f130e8d04cabcab702937 to your computer and use it in GitHub Desktop.
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
static List<int> SortArray(int[] array) | |
{ | |
int[] result = new int[array.Length]; | |
List<int> memory = new List<int>(); | |
List<int> toResult = new List<int>(); | |
foreach (var x in array) | |
{ | |
memory.Add(x); | |
} | |
check: | |
for (int i = 0; i < memory.Count(); i++) | |
{ | |
toResult.Add(memory.Min()); | |
memory.RemoveAt(memory.IndexOf(memory.Min())); | |
} | |
if (memory.Count() != 0) | |
{ | |
goto check; | |
} | |
return toResult; | |
} |
Author
paulohenriquesn
commented
Oct 4, 2018
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment