### 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.

 ``1234567891011121314151617`` ``````std::vector a ; // vector of int std::vector b ; // vector of double std::vector< std::list > c ; // vector of list of int ; std::vector< std::vector > d ; // vector of vector of int ; int* p = nullptr ; // pointer to int int** pp = &p ; // pointer to pointer to int std::vector* pvd = &b ; // pointer to vector of double std::vector 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.