Chapter 41 Flashcards
What are 3 components of STL
- Container
- Iterator
- Algorithm
What are containers
Container is an object that contains a collection of data elements
What are 3 kinds of containers
STL provides 3 kind of containers
- Sequence containers
- Associative containers
- Adapters containers
What is sequence container
A sequence container organizes a finite set of objects, all of same type, into a strictly linear arrangements.
What are examples of sequence container
- vector
- deque
- list
What is associative container
As associative container provides fast retrieval of data based on keys
What are examples of associative container
- map
- multimap
- set
- multiset
What about first-class container
Sequence and associative containers collectively called first-class container
What are adapters containers
Adapter container is constrained version of first-class containers
What are examples of adapter container
- stack
- queue
- priority_queue
Is stack LIFO
Yes
Is queue FIFO
Yes
What is copy constructor
The copy constructor is a constructor which creates an object by initializing it with an object of the same class, which has been created previously