Array in Data Structure
Array in Data Structure
Array
• Arrays are defined as the collection of similar types of
data items stored at contiguous memory locations.
• Each item in an array is indexed starting with 0 .
• Each element in an array is accessed through its index.
• It is one of the simplest data structures where each data
element can be randomly accessed by using its index
number.
Properties of array
• Each element in an array is of the same data type and
carries the same size that is 4 bytes.
• Elements in the array are stored at contiguous memory
locations from which the first element is stored at the
smallest memory location.
• Elements of the array can be randomly accessed since we
can calculate the address of each element of the array
with the given base address and the size of the data
element.
Representation of an array
Space Complexity: