I have a switch with 100 cases which I have to go through. So I was wondering that which approach will have less space complexity.
This question
In PHP what's faster, big Switch statement, or Array key lookup
somewhat answers the time complexity but they did not take into account the memory factor.