Step 1: for i = 1 to n-1 Repeat step 2Step 2: for j = i downto 1 Repeat step 3Step 3: is ( a[j] < a[j-1])? thentemp = a[j]A[j] = a[j-1]A[j-1] = temp [ end of j loop][ end of i loop]
Your experience on this site will be improved by allowing cookies. Read Cookie Policy