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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly