From the course: Get Ready for Your Coding Interview

Unlock the full course today

Join today to access over 23,100 courses taught by industry experts.

Overview of two-dimensional arrays

Overview of two-dimensional arrays

- [Instructor] Here's a quick overview of two-dimensional array. Two-dimensional arrays are often used in coding interviews, so let's examine how it works. Conceptually, a two-dimensional array is a collection of items, for example a collection of numbers, that's laid out in a two-dimensional table. For example, this table on the screen has two rows and four columns with the items one, three, nine, four, five, zero, eight, and negative three. A two-dimensional array like this one is usually implemented as an array of arrays, or in Python, as a list of lists. So this two-dimensional array would be typically represented as an array of two arrays, the first one containing the first row, one, three, nine, four and the second array containing the second row, five, zero, eight, and negative three. One common assumption here is that a two-dimensional array has a rectangular shape. What that means is each row has the same…

Contents