figure result of applying the bubble sort algorithm to the sample sequence the gray boxes show the values that are in order after each outer-loop traversal of iterations for the inner loop will be the sum of the first integerswhich equals ( resulting in run time of ( bubble sort is considered one of the most inefficient sorting algorithms due to the total number of swaps required given an array of keys in reverse ordera swap is performed for every iteration of the inner loopwhich can be costly in practice the bubble sort algorithm as implemented in listing always performs iterations of the inner loop but what if the sequence is already in sorted order