Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
This comment is hidden because it contains spoiler information about the solution
Sorry :D
@simonvpe
: never post your code without thespoiler
flag activated. ;)(I flagged it)
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Please feel free if you are so inclined. I'm always interested in performance comparisons and learning a bit more about optimization.
If you benchmark your map solution with one that scans the whole range you will see that it takes an incredible amount of items for your solution to be faster, not sure millions is enough.
std::map is the worst container in the language, next to std::list (std::map uses std::list in its implementation). Scanning a contiguous segment of memory is cache friendly and about 300 times faster (depending on the CPU) than a memory lookup. Not to mention all the dynamic memory allocations you force with your implementation.
I just might provide you with some performance benchmarks to prove my point.
This comment is hidden because it contains spoiler information about the solution
lol wtf?