array
array
Reference Notes
Some points to be revised again
4) An array is a collection of similar elements
(2) The first element in the array is numbered0, so the
last element is 1 less than the size of
the array.
(3) Before using an array its type and dimension must be declared.
4) Array element are always stored in continuous memory locations.
Size of the array remains constant.
int stud[4J[2]
1234,56
#1212,33},
1342, 32},
{2145, 46}
The method which tràyerses array sequendally to locate item is called Linear search or
sequential search. In the best posSible case, the item may occur at frst position. In this case, the
search operation terminates in success withjuat one comparison. However the worst case occurs
when either the item is present at last position or missing from the array. Thus in worst case the
linear searçh is O(n) operaiions