Practice
Learn
← Quit
0 / 0 correct
Rust
Hard
1 of 40
Why can Vec::push be slow if called in a hot loop with a known final size?
A
push is O(n)
B
push always allocates
C
push zeroes memory
D
Repeated reallocations copy the buffer; reserve or with_capacity upfront avoids them