What is another name for a Vector inside of a Vector

What is another name for a Vector inside of a Vector. What is the name of this construct? Would it be a Constructor Vector? I think this is a trick question my teacher is asking...
A nested vector?

usually in programming X inside of X means nested X.

I'll bet money that she means a multidimensional vector though... some people call it nested some multidimensional, some even 2D vector, just go with

multidimensional vector.
or matrix.
> What is another name for a Vector inside of a Vector.

It is usually called a vector.

Just as a pointer to a pointer is called a pointer.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
std::vector<int> a ; // vector of int

std::vector<double> b ; // vector of double

std::vector< std::list<int> > c ; // vector of list of int ;

std::vector< std::vector<int> > d ; // vector of vector of int ;

int* p = nullptr ; // pointer to int

int** pp = &p ; // pointer to pointer to int

std::vector<double>* pvd = &b ; // pointer to vector of double

std::vector<int*> e ; // vector of pointer to int

// etc... 


mutexe wrote:
matrix

(Mathematical, 2D) matrix is a special case, as it is rectangular, i.e.
d[i].size() == d[j].size() for all i,j in [ 0, d.size() )

On a more general case of vectors of vectors, the "inner" vectors do not have to have the same size.


Well, one could have triangular or sparse matrix, where implementation is not actually rectangular.
Topic archived. No new replies allowed.