Answer:1. [Loop on pass index]
Repeat through step 4 for pass=1 to n-1.
2. Initialize minindex
minindex <-- pass.
3. [Make a pass and obtain element with smallest value]
Repeat for i=pass+1,pass+2,….n.
If k[i] < k[minindex]
then minindex <-- i.
4. [Exchange the elements]
If minindex!=pass
then k[pass] interchange with k[minindex].
5. Finish
return.