by jmreardon · 15y ago · 0 comments
If you had a form where the number of checkboxes scaled with the number of items on the list, then you might end up with an O(n^2) algorithm, depending on how exactly they scale.
My problem would have been N^N if I had been doing "for every checkbox... for every checkbox" instead of "for every checkbox... for every product..."
So it wasn't n^2, but it was scaling poorly.
The way I rewrote it, I had (Number of products) operations. So for 200 products, I had 200 operations.
You can see that this made it much more tenable to add 100 more products, even if it wasn't N^2.