News for hackers. Stuff that matters.
Re:Ask HN: When was the last time you used big-o in a web app? by billybob on Wednesday August 03, 2011 @09:03AM (#2840952)
You're right - it wasn't O(n^2); the number of operations was (Number of checkboxes) x (Number of products). So with 10 checkboxes and 200 products, I had 2000 operations. 201 products = 2010 operations.

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.

There are no comments on this comment yet.