3 ms·
Not mentioned is spatial hashing, which works well without complex data structures. Also sad that you need all this complexity to test 25 balls in Javascript.
by yazzku 2y ago
Not mentioned is spatial hashing, which works well without complex data structures.
Also sad that you need all this complexity to test 25 balls in Javascript. 25^2 is a small number in C, especially when your balls fit in cache.
Still a good introduction to various algorithms, though.