10-06-2017, 06:54 AM
Array
[attachment=16923]
Operations on Array-insertion
To insert the new elements in the existing array following different positions of the arrays used:
1At the end of the array.
2At the beginning of the array
3At given position
Insertion at the beginning of the array:
If UB=MAX then write array is overflow and Stop
Read Data
K <-UB
Repeat step 5 while k>=LB
A(k+1) <- A(k)
K<-k-1
A(LB) <-Data
Stop
Operations on Array-Deletion
Deletion is possible in three ways
From the end
From the begning
From the given location
Two-Dimensional Array
An array in which the elements need to be referred by two indices.
It is also called matrix.
Represented as:
A[i][j] for 0<=i<=m and 0<=j<=n
Where m is number of rows
n is number of columns