0
C++ Vectors
I failing to understand vectors l mean the whole topic
5 Risposte
+ 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.
+ 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.
0
Accessing and insertion l understand it but deletion it's shaking me a lot