Definition
An instance A of the parameterized data type array2<E> is a mapping from a set of pairs I = [a..b] x [c..d], called the index set of A, to the set of variables of data type E, called the element type of A, for two fixed intervals of integers [a..b] and [c..d]. A(i, j) is called the element at position (i, j).
#include < LEDA/core/array2.h >
Creation
array2<E> | A(int a, int b, int c, int d) | |
creates an instance A of type array2<E> with index set [a..b] x [c..d]. | ||
array2<E> | A(int n, int m) | creates an instance A of type array2<E> with index set [0..n - 1] x [0..m - 1]. |
Operations
Implementation
Two dimensional arrays are implemented by C++vectors. All operations take time O(1), the space requirement is O(I*sizeof (E)).