/compare the adjacent elements *if list[jlist[ + then /swap them *swaplist[ ]list[ + swapped true end if end for /*if no number was swapped that means array is sorted nowbreak the loop *if(not swappedthen break end if end for end procedure return list