Click here to hide categories Click here to show left categories

User: Home          welcome : Guest          Log In / Register here     




What are Advantages and Disadvantages of arrays?

Advantages:

1. It is used to represent multiple data items of same type by using only single name.
2. It can be used to implement other data structures like linked lists, stacks, queues, trees, graphs etc.
3. 2D arrays are used to represent matrices.

Disadvantages:

1. We must know in advance that how many elements are to be stored in array.
2. Array is static structure. It means that array is of fixed size. The memory which is allocated to array can not be increased or reduced.
3. Since array is of fixed size, if we allocate more memory than requirement then the memory space will be wasted. And if we allocate less memory than requirement, then it will create problem.
4. The elements of array are stored in consecutive memory locations. So insertions and deletions are very difficult and time consuming.

Share this article   |    Print    |    Article read by 170757 times
Author:
Rohit kakria
I am software developer
Related Articles:
Related Interview Questions: