Selection Sort Time : O(n^2) Space : O(1) 1234567891011121314vector<int> selectionSort(vector<int> array) { int n = array.size(); for(int i = 0; i < n; i++) { int mi = array[i], idx = i; for(int j = i; j < n; j++) { if(mi > array[j]) { mi = array[j], idx = j; } } swap(array[i], array[idx]); } return array;}