-
-
Save parzibyte/7236e08f129c9f2d9e30ef14c48ec8b6 to your computer and use it in GitHub Desktop.
This file contains 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
/* | |
https://parzibyte.me/blog | |
*/ | |
static void Main(string[] args) | |
{ | |
int[] numeros = { 15, 1, 34, 5, 90, 10, 6 }; | |
Console.WriteLine("Antes de ordenar"); | |
foreach (var numero in numeros) | |
{ | |
Console.Write(numero + ","); | |
} | |
Console.WriteLine(""); | |
ordenarBurbuja(numeros); | |
Console.WriteLine("Después de ordenar ascendente"); | |
foreach (var numero in numeros) | |
{ | |
Console.Write(numero + ","); | |
} | |
Console.WriteLine(); | |
ordenarBurbujaDescendente(numeros); | |
Console.WriteLine("Después de ordenar descendente"); | |
foreach (var numero in numeros) | |
{ | |
Console.Write(numero + ","); | |
} | |
Console.WriteLine(); | |
string[] cadenas = { "Luis", "Zelda", "Link", "Aloy", "Ethan" }; | |
Console.WriteLine("Arreglo de cadenas antes de ordenar: "); | |
foreach (var cadena in cadenas) | |
{ | |
Console.Write(cadena + ","); | |
} | |
Console.WriteLine(); | |
ordenarBurbujaCadenas(cadenas); | |
Console.WriteLine("Arreglo de cadenas antes de ordenar: "); | |
foreach (var cadena in cadenas) | |
{ | |
Console.Write(cadena + ","); | |
} | |
Console.WriteLine(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment