Space complexity, recursion and amortised cost
Comes up in: DSA, Recruiter screen
This concept is being written. It gets the full five steps — explanation, predict, interview angle, practice with tests, and review cards. Here is exactly what it will cover, so you can study it elsewhere in the meantime.
What it covers
- auxiliary space
- recursion stack space
- amortised O(1) push on dynamic arrays
- hash map average vs worst
- complexity of common JS methods (
includes,indexOf,slice,splice,sort, spread)
Words you will know
What you will practise
- complexity of 10 JS built-ins quiz
Interview questions this answers
- What is the complexity of
Array.prototype.sortin V8? - How much stack space does a recursive DFS use?