If n is odd, the algorithm requires an extra iteration of the inner loop due to Step 7 of the previous section. As a result, the total number of iterations for odd number of elements is ((n2 − 6n + 8)/8) + 1. Thus, the average case time complexity is O(n2).