How does the vector::size() returns size of the vector in constant time?
I was going through this C++ Reference and found that using vector::size() returns the size of the vector in constant time. But, I wonder how one could get the size without actually traversing the vector.
Aucun commentaire:
Enregistrer un commentaire