Реализации алгоритмов/Сортировка/Пузырьком: различия между версиями

Содержимое удалено Содержимое добавлено
Строка 129:
== C# ==
<source lang="csharp">
static int[] BubbleSort(int[] mas)
int temp;
for (int i = 0; i < mas.Length; i++){
int temp;
{
for (int ji = i + 10; ji < mas.Length; ji++)
{
if for (mas[int j = i] >+ 1; j < mas[.Length; j]++)
{
temp = if (mas[i]; > mas[j])
mas[i] = mas[j]; {
mas[j] = temp = mas[i];
} mas[i] = mas[j];
} mas[j] = temp;
}
}
}
return mas;
}
}
return mas;
{ }
</source>