Lecture 8 Flashcards

1
Q

Vector

A

Collection of some number of variables. Address the problems with arrays

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

Generic Programming

A

Allows a general algorithm to be written that works for all data types. Increases efficiency.

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

Template

A

A formula for creating a generic class or function

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

Class

A

User defined data type

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

Push_back

A

Member function that adds a new element to the end of a vector

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

Member function

A

A function that can operate on any object of a the class which it is defined in.

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

Vector declaration

A

Vector<type> name;
Or
Vector<type> name(size);
Or
Vector<type> name(size, initial value of all elements)</type></type></type>

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

Vector initialization

A

Vector<type> name = {element, element...}
Or
name = {element, ...}</type>

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

Options to initalize size

A
  1. Initialize in parentheses
  2. Initialize elements and size will automatically initialize
  3. Initialize in parentheses with starting values
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Size function

A

Function to find the size of a vector.

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

Data structure

A

A group of data elements grouped together under one name.

An organized way to store a collection of data: e.g. Array, vector, etc.

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