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