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