 This results in a worst case of time for this sorting algorithm.This worst case occurs when the algorithm operates on an already sorted set, or one that is nearly sorted, reversed or nearly reversed.Expected time can however be achieved by shuffling the array, but this does not help for equal items.