0

C++ Vectors

I failing to understand vectors l mean the whole topic

15th Aug 2025, 9:23 PM
Delroy Zemudzo
Delroy Zemudzo - avatar
5 Respostas
+ 6
Vector is essentially a dynamic array that can automatically resize itself and supports efficient element access, insertion, and deletion operations. Just assume it's a better version of array.
16th Aug 2025, 2:34 AM
SAN
SAN - avatar
+ 3
a short comparison from a ai: array has a fixed size, is stored on the stack, cannot be resized, and is very fast because it avoids heap allocations. It is best when the size is known at compile time. vector has a dynamic size, is stored on the heap, can be resized with operations like push_back, has a small overhead due to dynamic allocation (not as fast as areay), and is best when the size can change or is not known at compile time.
16th Aug 2025, 1:53 PM
nora
nora - avatar
0
Accessing and insertion l understand it but deletion it's shaking me a lot
16th Aug 2025, 7:09 AM
Delroy Zemudzo
Delroy Zemudzo - avatar