When would you use Vectors over Linked Lists and vise-versa ?
When would you use Vectors over Linked Lists and vise-versa ?
A vector is a linked list that is premade. Personally, I like to use vectors because the code is effecient and already made. Why reinvent the wheel??
Are Vectors ANSI C++ ?
I believe that elements of a std::vector are guaranteed by the C++ standard to be continous in memory, hence it's not a linked list (std::list is the STL linked list).
You would use a std::vector when you want fast random access; a std::list when you want fast insertion/deletion.