Array
Also known as: list, collection
An ordered collection of values stored together and accessed by their numeric index position. Essential for handling lists, sequences, and collections of data.
๐ก Intuition
A numbered list. Item 0, item 1, item 2... Access any by its number.
Core Idea
Arrays store multiple related values under one name, making it easy to iterate over them all.
๐ฌ Example
๐ฏ Why It Matters
Essential for handling lists, sequences, and collections of data.
โ ๏ธ Common Confusion
Most languages index from 0, not 1. The last element of a 3-item array is at index 2.
Related Concepts
Prerequisites
How Array Connects to Other Ideas
To understand array, you should first be comfortable with variable and data types. Once you have a solid grasp of array, you can move on to iteration, searching and sorting.
Go Deeper
Frequently Asked Questions
What is Array in CS Thinking?
An ordered collection of values stored together and accessed by their numeric index position.
Why is Array important?
Essential for handling lists, sequences, and collections of data.
What do students usually get wrong about Array?
Most languages index from 0, not 1. The last element of a 3-item array is at index 2.
What should I learn before Array?
Before studying Array, you should understand: variable, data types.