Nepedia
Back to Discover
Independent Reader
💻

Array (data structure)

technology Maturity 11-13 Next article →

Computers use special lists called arrays.

1D array diagram
1D array diagram

An array is a collection of items. These items are all the same size. Each item has a number to identify it. We call this number an index.

2D array diagram
2D array diagram

You can use the index to find an item quickly. This is possible because of a math formula. The computer knows the starting spot, called the base address. It uses the index to calculate exactly where each item sits in memory.

Some arrays are simple lines. We call these one-dimensional arrays. Other arrays look like grids. These are two-dimensional arrays, or matrices.

3D array diagram
3D array diagram

You can even have three-dimensional arrays. These use three indices to find an item.

Many programs use arrays every day. They help make lists and strings. They are also used to build databases. Arrays are very important. They help computers work in a fast and efficient way. Most modern computers use arrays to manage their memory.

155 words

Where will your curiosity go next?

Keep exploring at your chosen reading level.

🖼️ Images & Media (5)
File:1D array diagram.svg
1D array diagram.svg
File:2D array diagram.svg
2D array diagram.svg
File:3D array diagram.svg
3D array diagram.svg
File:Row_and_column_major_order.svg
Row_and_column_major_order.svg
File:Array of array storage.svg
Array of array storage.svg
More to explore

What is Nepedia?

A free, ad-free encyclopedia for children. Every article is written at five reading levels, so the same page works for a five-year-old and a fifteen-year-old — use the level switcher above to see this one change. No account needed to read.