Re:I had to give a wrong answer to get the job (2017)
by remram on Friday July 23, 2021 @03:02PM
(#27934398)
To be clear, there is no tradeoff in the number of operations. You are doing the exact same number on average (or total or amortized), while improving the worst-case.
You do lose the ability to do a no-copy realloc() though, and increase the average memory use (not peak).
You do lose the ability to do a no-copy realloc() though, and increase the average memory use (not peak).