elementary sort: selection sort