COMPUTER SCIENCE AND ENGINEERING
DATA STRUCTURES
Question
[CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
|
|
Fixed size
|
|
There are chances of wastage of memory space if elements inserted in an array are lesser than the allocated size
|
|
Insertion based on position
|
|
Accessing elements at specified positions
|
Detailed explanation-1: -1. Which of the following is not a disadvantage to the usage of array? Explanation: Array elements can be accessed in two steps.
Detailed explanation-2: -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-3: -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.
Detailed explanation-4: -Which of the following is a disadvantage of dynamic arrays? Explanation: Dynamic arrays share the advantage of arrays, added to it is the dynamic addition of elements to the array. Memory can be leaked if it is not handled properly during allocation and deallocation. It is a disadvantage.