 It then starts again with the first two elements, repeating until no swaps have occurred on the last pass.This algorithm's average time and worst-case performance is O("n"2), so it is rarely used to sort large, unordered data sets.Bubble sort can be used to sort a small number of items (where its asymptotic inefficiency is not a high penalty).