and when there' no swap requiredbubble sorts learns that an array is completely sorted now we should look into some practical aspects of bubble sort algorithm we assume list is an array of elements we further assume that swapfunction swaps the values of the given array elements begin bubblesort(listfor all elements of list if list[ilist[ + swap(list[ ]list[ + ]end if end for return list end bubblesort pseudocode we observe in algorithm that bubble sort compares each pair of array element unless the whole array is completely sorted in an ascending order this may cause few complexity issues like what if the array needs no more swapping as all the elements are already ascending to ease-out the issuewe use one flag variable swapped which will help us see if any swap has happened or not if no swap has occurredi the array requires no more processing to be sortedit will come out of the loop pseudocode of bubblesort algorithm can be written as follows procedure bubblesortlist array of items loop list countfor to loop- doswapped false