ARRAYS
ARRAYS
1 INTRODUCTION
Index
3 OPERATIONS OF ARRAY
4 SEARCHING TECHNIQUES
5 SORTING TECHNIQUES
6 DISADVANTAGES
Introduction
An array is a data structure that stores a collection of elements, typically
of the same data type, in a contiguous block of memory. Arrays are used
to store multiple values in a single variable, which can be accessed using
an index.
Representation
2. THREE-DIMENSIONAL ARRAYS
When we require to create two or more tables of the elements to declare the
array elements, then in such a situation we use three-dimensional arrays.
Syntax: DataType ArrayName[size1][size2][size3];
For Example: int a[5][5][5];
Operations on Array
Traversal: Accessing each element of an array sequentially, either from the
beginning to the end or vice versa.
Deletion: Removing an element from an array, which may require shifting the
remaining elements to fill the gap. The element to be deleted can be at any
location.
Search: Finding a specific element in an array by comparing it with each
element until a match is found. Common search algorithms include linear
search and binary search.