Chapter 41 Flashcards

1
Q

What are 3 components of STL

A
  • Container
  • Iterator
  • Algorithm
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are containers

A

Container is an object that contains a collection of data elements

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are 3 kinds of containers

A

STL provides 3 kind of containers

  • Sequence containers
  • Associative containers
  • Adapters containers
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is sequence container

A

A sequence container organizes a finite set of objects, all of same type, into a strictly linear arrangements.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What are examples of sequence container

A
  • vector
  • deque
  • list
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is associative container

A

As associative container provides fast retrieval of data based on keys

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What are examples of associative container

A
  • map
  • multimap
  • set
  • multiset
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What about first-class container

A

Sequence and associative containers collectively called first-class container

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What are adapters containers

A

Adapter container is constrained version of first-class containers

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What are examples of adapter container

A
  • stack
  • queue
  • priority_queue
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Is stack LIFO

A

Yes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Is queue FIFO

A

Yes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is copy constructor

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly