1. Arrays in c
(1-Dimensional & 2-Dimensional)
By:
Anish Kumar
12/CS/60
Haldia Institute Of Technology
Introduction1-D2-DApplicationsOperations
LimitationsConclusionBibliography
2. Introduction
Array is a derived data type that represents a collection of the
similar types of data with continuous memory locations with
fixed size sequence.
Roles
Efficient storing of large volume of data
Efficient access and manipulation of data
Helpful in viewing complex problem in simpler way
Single name for multiple data
Structured Data Type
3.
4. 1-Dimensional Array
Data_type var_name[Expression]
Data Type is the type of elements to be stored in the array
Var_name is the name of the array like any
Other variables
Expression specifies the number of elements to be stored
In array
Example : int num[10];
char city[9]= “HALDIA”;
char city[9]={ ‘H’,’A’,’L’,’D’,’I’,’A’}
Num[0] =data1
Num[1] =data2
Num[2] =data3
Num[3] =data4
Num[4] =data5
Num[5] =data6
Num[6] =data7
Num[7] =data8
Num[8] =data9
Num[9] =data10
6. Applications
Matrix Problem
Solving different algorithms, graph & tree problem
Parse Matrix
Storing and searching of large amount of data
Stack, Queue
Array of pointers, Dynamic Arrays
8. Limitations
Wastage of memory space. We cannot change size of
array at the run time.
It can store only similar type of data.
Sometimes it is not easy to operate with many index
arrays.
9. Conclusion
Array has added a new flavour to the programming, the
efficiency of C language has reached to zenith in terms of
efficient storing , accessing and manipulation of data, speed and
reliability.
Bibliography
ANSI C by E Balagurusamy
http://www.slideshare.net
Wikipedia