Bifalgorithm post · Computer science one · Dynamic Data Structures

How is a contiguous two-dimensional array represented using pointers?

How is a contiguous two-dimensional array represented using pointers? (Computer science one · Dynamic Data Structures) — "20. Arrays **m m[0] m[1] m[2] m[3] m[…

Ideas in this flowchart

  • Contiguous two-dimensional arrays
  • The pointer-to-pointers variable m is initialized to an array of pointers.
  • The pointer array contains m[0] through m[3].
  • A contiguous 4 × 3 array is created.
  • Each pointer is initialized to its proper location in the contiguous array.
  • The elements can be accessed with two-dimensional notation such as m[0][0] through m[3][2].
  • The resulting structure can be treated as a two-dimensional array.
  • Figure 20.2 illustrates the contiguous two-dimensional array.
Feed/

How is a contiguous two-dimensional array represented using pointers?

No cover

Channel

Computer science one

1 page

"20. Arrays **m m[0] m[1] m[2] m[3] m[0][0] m[0][1] m[0][2] m[1][0] m[1][1] m[1][2] m[2][0] m[2][1] m[2][2] m[3][0] m[3][1] m[3][2] Figure 20.2.: Contiguous Two Dimensional Array. The initial pointer-to-pointers m is initialized to an array of pointers, m[0]..m[3] . A 4 × 3 contiguous array is created and each of the pointers is initialized to the proper location so it can be treated as a two-dimensional array."

Flowchart preview
👍
0
0 comments0 shares

Sign in to view and post comments.