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
What is the default data structure?
Deque
Which adapter classes provide member functions push and pop?
All of them
What does top() do?
View and display top element
Queue is?
First in first out
Stack is?
Last in first out
What does front() do?
View front element of queue