selection sort time complexity and space complexity