2D Array - Data Structures and Algorithm.(4)
2D array can be defined as an array of arrays. The 2D array is organized as matrices which can be represented as the collection of rows and columns. However, 2D arrays are created to implement a relational database look alike data structure. It provides ease of holding bulk of data at once which can be passed to any number of functions wherever required. How to declare 2D Array The syntax of declaring two dimensional array is very much similar to that of a one dimensional array, given as follows. int arr[max_rows][max_columns]; however, It produces the data structure which looks like following. Above image shows the two dimensional array, the elements are organized in the form of rows and columns. First element of the first row is represented by a[0][0] where the number shown in the first index is the number of that row while the number shown in the second index is the number of the column. How do we access data in a 2D array Due to the fact that the elements of 2D arrays c...