Computer Science Engineering (CSE) Exam  >  Computer Science Engineering (CSE) Questions  >  What are the disadvantages of arrays?a)Data s... Start Learning for Free
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
Correct answer is option 'B'. Can you explain this answer?
Most Upvoted Answer
What are the disadvantages of arrays?a)Data structure like queue or st...
Disadvantages of Arrays

Arrays are one of the fundamental data structures in computer programming, but they have certain disadvantages that need to be considered when deciding to use them. One of the main disadvantages of arrays is the potential wastage of memory space if the elements inserted in the array are lesser than the allocated size.

1. Wastage of Memory Space
When an array is created, a fixed amount of memory space is allocated to hold a certain number of elements. If the number of elements inserted in the array is less than the allocated size, there will be unused memory space. This can be inefficient in terms of memory utilization, especially if the array size is significantly larger than the number of elements it actually holds.

For example, let's say we allocate an array of size 10 to store integers. However, we only insert 5 integers into the array. In this case, half of the allocated memory space is wasted. This wastage becomes even more significant as the size of the array increases.

2. Inflexible Size
Arrays have a fixed size, which means that once created, the size cannot be changed easily. If the number of elements to be stored in the array exceeds its allocated size, it requires creating a new array with a larger size and copying all the elements from the old array to the new one. This process can be time-consuming and inefficient, especially if the array is large or if frequent resizing is required.

3. Sequential Access
Another disadvantage of arrays is that elements are sequentially accessed. In order to access an element at a specific index, one must iterate through all the preceding elements. This can be inefficient for operations that require random access to elements, especially if the array is large.

Conclusion
While arrays are simple and efficient for many purposes, they do have some disadvantages. The potential wastage of memory space if elements inserted in the array are lesser than the allocated size is a significant drawback. This inefficiency can be mitigated by carefully choosing the size of the array based on the expected number of elements. Additionally, if the size of the array is expected to change frequently or if random access to elements is required, alternative data structures like linked lists or dynamic arrays may be more suitable.
Free Test
Community Answer
What are the disadvantages of arrays?a)Data structure like queue or st...
Arrays are of fixed size. If we insert elements less than the allocated size, unoccupied positions can’t be used again. Wastage will occur in memory.
Explore Courses for Computer Science Engineering (CSE) exam

Similar Computer Science Engineering (CSE) Doubts

Top Courses for Computer Science Engineering (CSE)

What are the disadvantages of arrays?a)Data structure like queue or stack cannot be implementedb)There are chances of wastage of memory space if elements inserted in an array are lesser than the allocated sizec)Index value of an array can be negatived)Elements are sequentially accessedCorrect answer is option 'B'. Can you explain this answer?
Question Description
What are the disadvantages of arrays?a)Data structure like queue or stack cannot be implementedb)There are chances of wastage of memory space if elements inserted in an array are lesser than the allocated sizec)Index value of an array can be negatived)Elements are sequentially accessedCorrect answer is option 'B'. Can you explain this answer? for Computer Science Engineering (CSE) 2024 is part of Computer Science Engineering (CSE) preparation. The Question and answers have been prepared according to the Computer Science Engineering (CSE) exam syllabus. Information about What are the disadvantages of arrays?a)Data structure like queue or stack cannot be implementedb)There are chances of wastage of memory space if elements inserted in an array are lesser than the allocated sizec)Index value of an array can be negatived)Elements are sequentially accessedCorrect answer is option 'B'. Can you explain this answer? covers all topics & solutions for Computer Science Engineering (CSE) 2024 Exam. Find important definitions, questions, meanings, examples, exercises and tests below for What are the disadvantages of arrays?a)Data structure like queue or stack cannot be implementedb)There are chances of wastage of memory space if elements inserted in an array are lesser than the allocated sizec)Index value of an array can be negatived)Elements are sequentially accessedCorrect answer is option 'B'. Can you explain this answer?.
Solutions for What are the disadvantages of arrays?a)Data structure like queue or stack cannot be implementedb)There are chances of wastage of memory space if elements inserted in an array are lesser than the allocated sizec)Index value of an array can be negatived)Elements are sequentially accessedCorrect answer is option 'B'. Can you explain this answer? in English & in Hindi are available as part of our courses for Computer Science Engineering (CSE). Download more important topics, notes, lectures and mock test series for Computer Science Engineering (CSE) Exam by signing up for free.
Here you can find the meaning of What are the disadvantages of arrays?a)Data structure like queue or stack cannot be implementedb)There are chances of wastage of memory space if elements inserted in an array are lesser than the allocated sizec)Index value of an array can be negatived)Elements are sequentially accessedCorrect answer is option 'B'. Can you explain this answer? defined & explained in the simplest way possible. Besides giving the explanation of What are the disadvantages of arrays?a)Data structure like queue or stack cannot be implementedb)There are chances of wastage of memory space if elements inserted in an array are lesser than the allocated sizec)Index value of an array can be negatived)Elements are sequentially accessedCorrect answer is option 'B'. Can you explain this answer?, a detailed solution for What are the disadvantages of arrays?a)Data structure like queue or stack cannot be implementedb)There are chances of wastage of memory space if elements inserted in an array are lesser than the allocated sizec)Index value of an array can be negatived)Elements are sequentially accessedCorrect answer is option 'B'. Can you explain this answer? has been provided alongside types of What are the disadvantages of arrays?a)Data structure like queue or stack cannot be implementedb)There are chances of wastage of memory space if elements inserted in an array are lesser than the allocated sizec)Index value of an array can be negatived)Elements are sequentially accessedCorrect answer is option 'B'. Can you explain this answer? theory, EduRev gives you an ample number of questions to practice What are the disadvantages of arrays?a)Data structure like queue or stack cannot be implementedb)There are chances of wastage of memory space if elements inserted in an array are lesser than the allocated sizec)Index value of an array can be negatived)Elements are sequentially accessedCorrect answer is option 'B'. Can you explain this answer? tests, examples and also practice Computer Science Engineering (CSE) tests.
Explore Courses for Computer Science Engineering (CSE) exam

Top Courses for Computer Science Engineering (CSE)

Explore Courses
Signup for Free!
Signup to see your scores go up within 7 days! Learn & Practice with 1000+ FREE Notes, Videos & Tests.
10M+ students study on EduRev