4 ms·
I hate to be /that/ guy but Big O isn't something to memorize. It's a way to evaluate algorithms. You can memorize Big O for certain patterns of code but there
by drwl 10y ago
I hate to be /that/ guy but Big O isn't something to memorize. It's a way to evaluate algorithms. You can memorize Big O for certain patterns of code but there are ways to trip you up if you do this. (One example I came across was a for i < n loop, printing out a recursive Fibonacci function. If you memorize Big O you would be tempted to say O(n*2^n) but if you reason through it, it ends up being O(2^n).) So it's best not to memorize Big O.
I used to be in the same boat but after working past that initial anxiety and getting started in CtCI and Skiena's algorithms class to further my CS fundamentals, it turns out that the stuff being asked in interviews aren't that too hard. (this is a huge generalization)