MCQ IN COMPUTER SCIENCE & ENGINEERING

COMPUTER SCIENCE AND ENGINEERING

DATA STRUCTURES

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
Which of the following is the disadvantage of the array?
A
Stack and Queue data structures can be implemented through an array.
B
Index of the first element in an array can be negative
C
Wastage of memory if the elements inserted in an array are lesser than the allocated size
D
Elements can be accessed sequentially.
Explanation: 

Detailed explanation-1: -What are the disadvantages of arrays? Explanation: 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.

Detailed explanation-2: -Elements are stored in contiguous memory blocks. Multiple other data structures can be implemented using arrays. The disadvantage of arrays is that the amount of memory to be allocated should be known beforehand.

Detailed explanation-3: -Disadvantages of array data structure: Insertion and deletion operations are costly in arrays as elements are stored in contiguous memory. If the size of the declared array is more than the required size then, it can lead to memory wastage.

Detailed explanation-4: -1. Which of the following is not a disadvantage to the usage of array? Explanation: Array elements can be accessed in two steps.

There is 1 question to complete.