Definition
Array (from programmer’s view) - “a consecutive set of memory locations”
or in details, Array is -
So, being an ADT we will be more concerned with the operations that can be performed on an array. The array is useful for storing thousands of values in it and we access the values through the index. Usually, arrays are of fixed size.
Need of using Array
The efficiency of a computer lies in processing tens of thousands of data within a blink of an eye. Though we often start our programming journey with small example programs like -
Find minimum or maximum from given any two or three values.
Swap two values etc.
Having two or three variables may suffice in the above cases but for a large number of values, it is simply not possible. Arrays serve this purpose efficiently.
Types of Arrays
We can categorize into two -
One-dimensional array – sequence of finite homogeneous elements.
Multi-dimensional array – each element is an array of elements of a similar type. Here we discuss only two and three-dimensional arrays.
Properties of an array
One-dimensional array
In this site, we are providing some standard array programs. For any demand of new program please mail us.
Enjoy all programs related to array:
1. Find Maximum and Minimum from an array
2. Kth Largest and Smallest Element
3. 2nd largest element from the array
4. Find how many negative numbers are present in the array
5. The elements of one array are copied to another array
6. Delete an element from any position in array
7. Frequency of each element in the Array
8. Find out the unique elements from the Array
9. Finds odd and even elements from the array and stored in two separate arrays
10. Counts the number of odd and even elements separately from the array
11. The elements of one array are copied to another array
12. Reverses the elements of an Array
13. Marge two Array and store in the third Array
16. Sorted the array and then separate even and odd elements in different array
17. Sort the number of strings in an array
18. Check one given element of an array present more than n/2 times or not
19. The sum of the elements of an Array is calculated using a pointer