ITECC03 Flashcards

1
Q

How do you remove the last element from a vector in C++?

A

vector.pop_back()

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

Which method is used to clear all elements from a vector in C++?

A

vector.clear()

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

How to get the size of a vector in c++?

A

vector.size();

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

What is the function used to remove the first occurrence of a specific element from a vector?

A

erase()

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

What is the function used to find the first occurrence of a specific element from a vector?

A

find()

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

Which method is used to swap the contents of two vectors in C++

A

swap()

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