You are viewing a single comment's thread. Return to all comments →
void countSort(vector<vector<string>> arr) { map<int, vector<string>> strmap; for(int i = 0; i<arr.size(); i++){ string newc = i<arr.size()/2 ? "-" : arr[i][1]; strmap[stoi(arr[i][0])].push_back(newc); } for(auto&[key, vector] : strmap){ for(int k = 0; k<vector.size(); k++){ cout<<vector[k]<<" "; } } }
Seems like cookies are disabled on this browser, please enable them to open this website
The Full Counting Sort
You are viewing a single comment's thread. Return to all comments →