//Visual Basic 2010 Sorteren van Arrays - Bubble Sort Arrays public class BubbleSortExample { void Main() { int count = 5; int upperbound = (count - 1); int[] numbers = new int[0]; int index; this.numbers(index) = ((((count + index) * 93) % 97) - (count / (index + 1))); Console.Write("unsorted array : "); Console.Write((this.numbers(index) + " ")); Console.WriteLine(); int unsortedCount = count; for (; (unsortedCount > 1); ) { int endIndexUnsortedPart = (unsortedCount - 2); if ((this.numbers(index) > this.numbers((index + 1)))) { int backup = this.numbers(index); this.numbers(index) = this.numbers((index + 1)); this.numbers((index + 1)) = backup; } unsortedCount = 1; Console.Write("temporary array : "); Console.Write((this.numbers(index) + " ")); Console.WriteLine(); } Console.Write("sorted array : "); Console.Write((this.numbers(index) + " ")); Console.ReadLine(); } } //Bezoek www.vbvoorbeelden.be voor meer C# voorbeelden. //Copyright - De Wolf / vbvoorbeelden - 2003-2011 - Alle rechten voorbehouden.