Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Bubble Sort
//Rextester.Program.Main is the entry point for your code. Don't change it. //Compiler version 4.0.30319.17929 for Microsoft (R) .NET Framework 4.5 using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; namespace Rextester { public class Program { public static void Main(string[] args) { var A = new List<int> { -1, 3, -4, 5, 1, -6, 2, 1 }; BubbleSort(A); } //Bubble Sort public static void BubbleSort(List<int> items) { int i, j, temp; if (items == null) return; for (i = items.Count - 1; i >= 0; i--) { for (j = 1; j <= i; j++) { if (items[j - 1] > items[j]) { temp = items[j - 1]; items[j - 1] = items[j]; items[j] = temp; } } } foreach (var item in items) { Console.Write(" " + item.ToString()); } } } }
run
|
edit
|
history
|
help
0
Ejemplos polimorfismos con interfaces y posibles usos sencillos c#
Tarkov Time
ASCII -> Braille ASCII
from Base or Derived
Diagonal Difference
oooo
f
Sample Code
Program
test