A 2D array is a data structure that stores values in a grid-like format with rows and columns. It allows for efficient storage and retrieval of data elements.
Think of a 2D array as a spreadsheet, where each cell represents an element in the array. Just like how you can easily locate and modify data in specific cells of a spreadsheet, you can do the same with a 2D array.
firstDimension: The first dimension of a 2D array refers to the number of rows it has. It determines the vertical size or height of the grid.
secondDimension: The second dimension of a 2D array refers to the number of columns it has. It determines the horizontal size or width of the grid.
element: An element is an individual value stored within a 2D array. Each cell in the grid contains one element, which can be accessed using its row and column indices.
How do you traverse all the elements in a 2D array?
How do you access an element in a 2D array?
What is a 2D array?
How do you find the number of rows in a 2D array?
Which algorithm can be used to find the maximum value in a 2D array?
What is the advantage of using a 2D array over a 1D array?
What is the size of a 2D array with 3 rows and 4 columns?
What is the data type of a 2D array?
Which algorithm can be used to find the minimum value in a 2D array?
How many nested loops are required to traverse a 2D array?
What is the correct way to declare an empty 2D array of integers with 3 rows and 4 columns?
How would you initialize a pre-existing 2D array with the values: {1, 2, 3, 4} in the first row, {5, 6, 7, 8} in the second row, and {9, 10, 11, 12} in the third row?
What is the correct way to access the element in the second row and third column of a 2D array named "arrayC"?
Which of the following is NOT a valid way to declare a 2D array?
In the memory representation of a 2D array, the outer array contains:
What is the correct way to declare an empty 2D array with 2 rows and 3 columns of strings?
Which of the following is the correct double-index notation to access the element in the first row and second column of a 2D array named "arrayD"?
Which of the following is the correct double-index notation to access the element in the third row and second column of a 2D array named "arrayG"?
How would you access the element in the last row and last column of a rectangular 2D array named "arrayF"?
Study guides for the entire semester
200k practice questions
Glossary of 50k key terms - memorize important vocab
© 2024 Fiveable Inc. All rights reserved.
AP® and SAT® are trademarks registered by the College Board, which is not affiliated with, and does not endorse this website.