Machine-translated by Google. Questions are authored in English.
Top

Discussion

What are the disadvantages of arrays?

  • A.Data structure like queue or stack cannot be implemented
  • B.There are chances of wastage of memory space if elements inserted in an array are lesser than the allocated size
  • C.Index value of an array can be negative
  • D.Elements are sequentially accessed

Answer: B

Correct answer: There are chances of wastage of memory space if elements inserted in an array are lesser than the allocated size

An array’s size is fixed when it is created, so if fewer elements are stored than were allocated, the unused cells are still occupied memory. That is the classic drawback, and it is what dynamic structures such as linked lists and growable lists exist to avoid. Stacks and queues can be built on arrays, indices are never negative, and elements are reached directly by index rather than sequentially.

No comment is present. Be the first to comment.
Loading…

Post your comment

Please log in or register to post a comment.