Standard Template Library Flashcards
Three components of STL?
Containers, iterators, and algorithms
Containers are…
Template data structures
Iterators are….
Like pointers, access elements of containers
Algorithms are…
Data manipulation, searching, sorting
Sequence containers….
Arrays, lists, vectors, etc
Associative containers….
Sets, maps
Container adapters….
Stacks, queues, priority_queues
Iterators operator *
Dereferences
Iterators operator ++
Points to next element
Begin() member function of iterator class
Returns first element
End() iterator member function
Points to first element past end of container (determines end)
Const_iterators can….
Read but not write
Vector similar to array except…
Supports dynamic resizing
How to insert or delete in middle of vector?
insert()
erase()
Which containers do not support iterators?
Stacks and queues