A one-dimensional (1D) array is a linear collection of elements stored in contiguous memory locations. It allows storing multiple values under one name and accessing them using indices.
Think of a 1D array as a shelf with compartments. Each compartment holds an item (element), and you can access each item by specifying its position (index) on the shelf.
Array Index: The array index refers to the position of an element within an array. It starts from 0 for the first element and increments by 1 for each subsequent element.
Array Length: The array length is the total number of elements in an array. It represents the size or capacity of the array.
Array Initialization: Array initialization is the process of assigning initial values to elements in an array, either individually or using a loop.
Study guides for the entire semester
200k practice questions
Glossary of 50k key terms - memorize important vocab
© 2024 Fiveable Inc. All rights reserved.
AP® and SAT® are trademarks registered by the College Board, which is not affiliated with, and does not endorse this website.