3 ms·
> case statements are O(n), where n is the number of case/switch statements possible. What now? Not even close. Any modern or even semi-modern (2005-vintage) c
by dmitrygr 4y ago
> case statements are O(n), where n is the number of case/switch statements possible.
What now? Not even close. Any modern or even semi-modern (2005-vintage) compiler will compile large switches into a jump table (O(1)) and medium ones into a tree of branches, giving O(log n)