Standard Template Library Flashcards

1
Q

Three components of STL?

A

Containers, iterators, and algorithms

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

Containers are…

A

Template data structures

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

Iterators are….

A

Like pointers, access elements of containers

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

Algorithms are…

A

Data manipulation, searching, sorting

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

Sequence containers….

A

Arrays, lists, vectors, etc

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

Associative containers….

A

Sets, maps

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

Container adapters….

A

Stacks, queues, priority_queues

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

Iterators operator *

A

Dereferences

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

Iterators operator ++

A

Points to next element

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

Begin() member function of iterator class

A

Returns first element

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

End() iterator member function

A

Points to first element past end of container (determines end)

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

Const_iterators can….

A

Read but not write

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

Vector similar to array except…

A

Supports dynamic resizing

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

How to insert or delete in middle of vector?

A

insert()
erase()

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

Which containers do not support iterators?

A

Stacks and queues

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

What is the default data structure?

A

Deque

17
Q

Which adapter classes provide member functions push and pop?

A

All of them

18
Q

What does top() do?

A

View and display top element

19
Q

Queue is?

A

First in first out

20
Q

Stack is?

A

Last in first out

21
Q

What does front() do?

A

View front element of queue