The Array shows a hierarchical structure.
Arrays are immutable.
Container that stores the elements of similar types
The Array is not a data structure
int data[10];
int data;
data{20};
array data[10];
int arr[2]=(10, 20)
int arr(2)={10, 20}
int arr[2] = {10, 20}
int arr(2) = (10, 20)
Elements of mixed data types can be stored.
Easier to access the elements in an array
Index of the first element starts from 1.
Elements of an array cannot be sorted
Binary Search tree
Caching
Spatial locality
Scheduling of Processes
we can store only positive value in array
we can store characters in array
the size of array is fixed at declaration time
it is mutable ie. we can not change the value of array
A data structure that shows a hierarchical behavior
Container of objects of similar types
Arrays are immutable once initialised
Array is not a data structure
int arr[3] = (1,2,3);
int arr(3) = {1,2,3};
int arr[3] = {1,2,3};
int arr(3) = (1,2,3);
Objects of mixed data types can be stored
Elements in an array cannot be sorted
Index of first element of an array is 1
Easier to store elements of same data type
-1
0
1
Size-1
randomly
sequentially
exponentially
logarithmically
Array
Queue
Stack
Linked List
Insertion
Deletion
Traversal
Searching in constant time
A collection of elements of different data types.
A collection of elements stored in a contiguous block of memory.
A collection of elements where each element has a unique key associated with it.
A collection of elements that are linked together by pointers.