Interview Cake Flashcards
1
Q
In-place vs Out-of-place Algorithms
A
Pros:
- Working in-place saves time and space
Cons:
- Can cause side effects
Out-of-place is considered safer because they avoid side-effects.
Only use in-place if you’re space constrained or you’re SURE you don’t need the original input anymore, even for debugging
2
Q
A