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.
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