Computer Science, asked by lavanya200209, 9 months ago

what are the advantages and disadvantages of arrays? ​

Answers

Answered by nariyalchampa
1

Answer:

if it's helpful marked me as brainlist plz

Explanation:

advantages:

Multiple data items of same data type can be accessed using single name.

Arrays can be used to implement matrices.

Data structure like queue , linked list can be accessed using arrays.

#disadvantages :

We must know in advance that how many elements are to be stored in an array.

Array is static structure.

Answered by Anonymous
3

Arrays are basically a collection of similar type of data in a contiguous memory location under one name.

Advantages-

  • collection of similar types of data.
  • if we want to store the marks of all students it will easy to store in array otherwise we have to store marks in different different location, which is not easy to memorise.
  • we have to only remember the first index of array.
  • used to implement other data structure like linked lists,stack,queue, trees, graph etc.
  • 2 Dimensional array is used to represent a matrix.

Disadvantages-

  • Time complexity increase in insertion and deletion operation.
  • Time complexity increase in insertion and deletion operation.
  • wastage of memory because arrays are fixed in size.
  • if there is enough space present in the memory bt not in contiguous form , in this case you will not able initialize your array.
  • it is not possible to increase the size of the array, once you had declared the array.
Similar questions