Program for selection sort