Answer:1. Initialize last <-- N.
2. [Loop on pass index]
Repeat through step 5 for pass=1,2…n-1.
3. [Initialize exchange ctr for this pass]
exchs <-- 0.
4. [Perform pair wise comparison on unsorted elements]
Repeat for i=1,2,….last - 1.
If k[i] > k[I+1]
then interchange both of them.
exchs <-- exchs + 1.
5. [Check for Exchanges]
If exchs=0
then return [mission complete early]
else
last <-- last – 1.
6. Finish
return.