bubble sort
RU: сортировка пузырьком
A comparison-based sorting algorithm that repeatedly passes through the array, swapping adjacent elements that are out of order. Each pass bubbles the largest unsorted element to its final position. Worst-case and average-case time is O(n²); with an early-exit check that stops after a pass with no swaps, the best case on already-sorted input is O(n).