Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 13

WELCOME TO OUR

PRESENTATION
Array is a data structure consisting of a
collection of elements, each identified
by at least one array index or key. An
ARRAY array is stored such that position of
each element can be computed from
its index tuple by a mathematical
formula.

20XX
ACCESSING ARRAY ELEMENTS

An element is accessed by indexing the array name. This is done by placing


the index of the element within square brackets after the name of the
array.
For example: double salary=balance[20]

Presentation title 20XX 3


TYPES
OF
ARRAY

One Two – Multi


Dimensional Dimensional Dimensional
Array Array Array

4
ONE – •An array in which the elements are stored and linearly
DIMENSION and can be accessed individually by specifying the index
value of each element stored in the array
AL ARRAY

20XX Presentation title 5


ONE DIMENSIONAL ARRAY

SYNTAX:

Data-type name[index];
NAME roll[0] roll[1] roll[2] roll[3] roll[4] roll[5] roll[6] roll[7]

VALUES 12 45 32 23 17 49 5 11
ADDRESS 1000 1002 1004 1006 1008 1010 1012 1014

1-D ARRAY MEMORY ARRANGEMENT

20XX
TWO-
• The general form of two-dimensional array
DIMENSIONA declaration is type array _ name [row size]
[Column size]
L ARRAY • Here the types specifies the data type of
elements of the array such as;
• int, float or char.
TWO -
DIMENSIONAL
ARRAY
MULTI DIMENSIONAL ARRAY

An array with more than two dimensions. In a matrix, the two


dimensions are represented by rows and columns. Each element
is defined by two subscripts, the row index and the column
index.
MULTIDIMENSIONAL ARRAY
10
•Till now, we have been storing data in simple
variables
NEED OF •Although storing data of large number of
ARRAY people is use
•to store this large data, the developers
developed the concept of arrays in language

Presentation title
ADVANTAGE OF ARRAY

HUGE AMOUNT OF DATA CAN BE SEARCHING OF DATA ITEM OF TWO DIMENSIONAL ARRAYS ARE
STORED UNDER SINGLE VARIABLE FASTER USED TO REPRESENT THE MATRIX
NAME

You might also like