People who code: we want your input. Take the Survey
3

Performance of std::map Well, looking up in a map is a slow operation. if(map[value] > 1){ map[value]--; is looking up the same thing twice. Don't do that with maps! You could write: auto& v= map[value]; if (v>1) --v; Hmm, but you continue with: else{ //std::cout << "found in map and deleleted: " &...


3

Here are some suggestions for improving readability of your code. The more readable / easily understandable your code is, the easier it is to properly review regarding performance. Naming This is probably the most important point regarding your code. More or less none of the variables have meaningful names. This makes it that much harder to understand your ...


Only top voted, non community-wiki answers of a minimum length are eligible