4. Data Collections

2d Array Traversals — Quiz

Test your understanding of 2d array traversals with 5 practice questions.

Read the lesson first

Practice Questions

Question 1

In a 2D array traversal, what does the outer loop usually control?

Question 2

If a 2D array has $3$ rows and $4$ columns, how many elements does it contain?

Question 3

Which expression correctly gets the element in row $i$ and column $j$ of a 2D array named $scores$?

Question 4

What is the main benefit of using nested loops to traverse a 2D array?

Question 5

What does the following traversal print for the array $grid = \{\{1,2\},\{3,4\}\}$ if it visits each element row by row?
2d Array Traversals Quiz — AP Computer Science A | A-Warded