|
A vector is just a wrapper for a template type array. "Is the space where the vector stores data is stack or deep?" I don't know what it means. It's like asking whether the stack is an array or a linked list. They are a logical layer and a physical layer . . Vector can be stored randomly. It can be understood as either heap or stack. Only the operation is different, stack is push_back, pop_back, heap is push_back, pop_front /
STL is more efficient than arrays because we do not have to be responsible for memory management, such as application and release, and there are probably applications for memory pools. Big data certainly recommends STL. |
|