`Vec<T>` stores elements contiguously on the heap with a length and capacity. push may reallocate; `with_capacity` avoids repeated growth. Indexing panics out of bounds while `get` returns an Option.
← Rust theorytheory 0/50 · 0%
Collections · easy
16. Vectors
Growable arrays.
Check your understanding
1. Which access returns Option?
2. What does with_capacity avoid?