1.

What is the difference between one dimensional and two dimension

Answer» \tBASIS FOR COMPARISONONE-DIMENSIONALTWO-DIMENSIONALBasicStore single list of elements of similar data type.Store \'list of lists\' or \'array of arrays\' or \'array of one dimensional arrays\'.Declaration/*declaration in C++ type variable_name[ size ];*/ /*declaration in Java type variable_name [ ]; variable_name = new type[size]; *//*declaration in C++ type variable_name[size1][size2]; */ /*declaration in Java type variable_name= new int[size1][size2]; */Alternative Declaration/* In Java int [ ] a= new int [10]; *//* In Java int [ ] [ ] a= new int [10][20]; */Total Size in BytesTotal Bytes =sizeof(datatype of array variable)* size of array.Total Bytes= sizeof(datatype of array variable)* size of first index*size of second index.Receiving parameterIt can be received in a pointer, sized array or an unsized array.Parameter receiving it should define the rightmost dimension of an array.DimensionsOne dimensional.Two dimensional.\t


Discussion

No Comment Found