Search the courses, subjects, tracks, games and features, or jump straight to a page.
2 cards from this section. Quick, good the night before a test.
What is a 2D array?
Think about how data is organized in a table.
How do you access the first element of a 2D array?
Remember, indexing starts at zero!
What is the output of the following code snippet where mat is initialized as {{1, 2}, {3, 4}}?
for (int i = 0; i < 2; i++) { for (int j = 0; j < 2; j++) { System.out.print(mat[i][j] + " "); } }
Pay attention to how the elements are printed.
True or False: A 2D array can be considered as an array in which each element is also an array.
Think about the definition of a 2D array.
Write a program that checks if a given 2D array is symmetric (the same forwards and backwards).
Think about how elements are mirrored in a symmetric matrix.
Create a function that finds the maximum value in a 2D array and returns its position.
Be methodical in checking each position as you search.
4 more questions in this section. Enroll free to practise them all.
Enroll free