What are the common time complexities you should recognize for interviews?
LeetCode Patterns Flashcards: Tries, Design Problems, LRU Cache, Time Complexity
Аудио-карточка · 0:30Nortren·
What are the common time complexities you should recognize for interviews?
0:30
From fastest to slowest: O of one is constant time regardless of input size, like hash table lookup. O of log n is logarithmic, like binary search. O of n is linear, like a single array pass. O of n log n is linearithmic, like efficient sorting. O of n squared is quadratic, like nested loops over the same array. O of two to the power of n is exponential, like generating all subsets. O of n factorial is factorial, like generating all permutations. Interviewers expect you to state and justify the time and space complexity of your solution.
neetcode.io