An array (of any dimension) is a linear and structured data type with the following properties and characteristics:

1. It is made up of finite n homogenous (of same type) data elements such that

a. Every data element is of fixed size. Size depends upon the specific nature of structure of the data elements.

b. The elements of the array are referenced respectively by an index set consisting of n consecutive numbers.

c. The elements of the array are stored respectively in successive contiguous memory locations. Array is a data–structure that uses memory statically unlike linked list, which is constructed on dynamic memory allocation.

**direct access**, which means we can access any element directly, without first accessing the preceding elements. The desired element is specified using an index, which gives its relative position in the collection. e.g.

A [0], A[1],…….. A[n-1]

3. Arrays are built–in data types in most of the programming languages including C and C++.

Length of Array A = UB – LB + 1

where **UB** is the largest index, called the upper bound, and **LB** is the smallest index, called the lower bound, of the array. In C and C++ languages, LB is always zero.

can u explain about n dimensional array ????

ReplyDeletePlease give some example to understand what you want to say.

ReplyDelete