An Example of an algorithm Algorithm sorting(X, n Algorithm sorting(x, n) Input array X of n integers Input array X of n integers Output array X sorted in a non- Output array X sorted in a non- decreasing order ecreasing order for it0 to n-do forj←-计+ton-ldo for i fromo to n- do fori from i+l to n-1 do if (Xixlilthen if X/i is largerthan Xil S- swap(X/i,xn i/, return X return X lafter i-th round, the i-th smallest after i-th round, the i-th smallest number is at i-th position number is at i-th position StacksAn Example of an Algorithm Algorithm sorting(X, n) Input array X of n integers Output array X sorted in a nondecreasing order for i 0 to n − 1 do for j i+1 to n-1 do if (X[i]>X[j])then { s=X[i]; X[i]=X[j]; X[j]=s; } return X // after i-th round, the i-th smallest number is at i-th position. Stacks 9 Algorithm sorting(X, n) Input array X of n integers Output array X sorted in a nondecreasing order for i from 0 to n − 1 do for j from i+1 to n-1 do if X[i] is larger than X[j] swap(X[i], X[j]) return X // after i-th round, the i-th smallest number is at i-th position