5 ms·
2^50 meets the definition of "complex", if you ask me
by jakub_g 6y ago
2^50 meets the definition of "complex", if you ask me
- robocat 6y agoAssuming there are only “if” and no “else”, then there would be 51 code paths (Presuming other preconditions like: the condition is code or there is some code within each if; the code cannot throw exceptions; there is no return statement; etcetera). You could perhaps have only two code paths: the 50 ifs are true and something happens, or any one of the ifs are false and something doesn’t happen... although that could be written as a single if statement with “and”s. The 2^50 case would be more code than we can store (unless using techniques that reduce the complexity i.e. not 2^50).