3 ms·
Where does the O(n²) come from? Is the number of neighbors unlimited? I was always under the impression that only a constant number of immediate neighbours coun
by rhn_mk1 5y ago
Where does the O(n²) come from? Is the number of neighbors unlimited? I was always under the impression that only a constant number of immediate neighbours counts.
- sdflhasjd 5y agoYes, it is linear, with a few small exceptions. The vast majority of element types in the game only check a fixed number of neighbours. Neighbour checking uses a 2-D map so it's constant-time.