What are the advantages and disadvantages of arrays?
Answers
Advantages:
1) Multiple data can be used to represent items of similar type by providing only single number of name.
2) It has a great benefit in using to execute for other data structures known as linked lists, stacks, queues, and many more cases.
3) 2D arrays are commonly applied to interpret matrices.
Disadvantages:
1) It is mandatory to become aware the number of elements to be stored in array.
2) Structure of Array is static in nature.This determines that array is of fixed size. The memory assigned to array may be controlled hence, can not be increased or decreased.
3) Size of array is limited , allocation of more memory than necessary will result wastage of space. Allocation of less memory it will create problems.
4)The elements of array are stored in consecutive locations. So insertions and deletions are extremely difficult.
Insertion and deletion are quite difficult in an array as the elements are stored in consecutive memory locations and the shifting operation is costly. Allocating more memory than the requirement leads to wastage of memory space and less allocation of memory also leads to a problem.
thnks____!!!!_____!!!!