MCQ IN COMPUTER SCIENCE & ENGINEERING

COMPUTER SCIENCE AND ENGINEERING

DATA STRUCTURES

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
int Array[][] = new int [3] [5];What kind of array is the example above.
A
One Dimensional
B
Two Dimensional
C
Three Dimensional
D
None of the above
Explanation: 

Detailed explanation-1: -You can think the array as a table with 3 rows and each row has 4 columns. Similarly, you can declare a three-dimensional (3d) array. For example, float y[2][4][3];

Detailed explanation-2: -A two-dimensional array is a data structure that contains a collection of cells laid out in a two-dimensional grid, similar to a table with rows and columns although the values are still stored linearly in memory.

Detailed explanation-3: -Here i and j are the size of the two dimensions, i.e i denotes the number of rows while j denotes the number of columns. Example: int A[10][20]; Here we declare a two-dimensional array in C, named A which has 10 rows and 20 columns.

Detailed explanation-4: -A two-dimensional array in C can be thought of as a matrix with rows and columns. The general syntax used to declare a two-dimensional array is: A two-dimensional array is an array of several one-dimensional arrays. Following is an array with five rows, each row has three columns: int my array[5][3];

There is 1 question to complete.