Array:-
An array is a list of finite number of elements of same data type i.e, integers, strings etc.Elements of an array cannot have different types of data. Array elements in computer memory are stored in a sequence of contiguous memory blocks. All the elements in an array are of the same data type, so only the memory blocks that are allocated for the elements of the array are also of the same size.
Every element of an array occupies a memory block. Now what will be the size of this memory block, it depends on the data type. The shortest address means 0 in the array is used to access the first element and the largest address high element.
Operations on array:-
The operations performed on linear structure i.e. arrays are:- Traversal: Processing each element in the array or list.
- Search: Finding the location of the element with a given value or widh a given key.
- Insertion: Adding a new element to the list.
- Deletion: Removing an element from the list.
- Sorting: Arranging the element in some type of order, ascending or descending.
- Merging: Combining two lists or arrays within a single list or array initialization.
Type Of Array:-
There is three types of array in C programming language:- One-Dimensional Arrays
- Two-Dimensional Arrays
- Multi-Dimensional Arrays
1. One-Dimensional Arrays:-
A one-dimensional array is a type of linear array.Read Also:
A list of items can be given one variable name using only one subscript and such a variable is called a one-dimensional array.
0 Comments