Bubble Sort
1. How many iterations of the outer loop are needed by the algorithm when the input array of size N is already sorted?
2. How many comparisons (same as the number of iterations of the inner loop) are required in the next iteration after T iterations of the outer loop in the optimized algorithm? The array size is N.
3. How do we check if our array is sorted in order to preemptively stop the optimized algorithm?