Infosys interview question

How does selection sorting work