Hacker News new | ask | show | jobs
by kazagistar 3035 days ago
If N is the number of nested loops, and M is the number of times through the loop, then it is indeed a O(M^N). So indeed, complexity scales exponentially with the level of nesting. The wording was just off amd confusing due to it being a nontraditonal formulation of the problem, but what he was saying does actually make sense.
1 comments

You will probably blow up stack on counters or iterators way before you reach even close to 2^N behaviour.