selection sort algorithm space complexity