Data Structure Questions and Answers – Dynamic Array
This set of Data Structure Multiple Choice Questions & Answers (MCQs)
focuses on “Dynamic Array”.
1. What is a dynamic array?
a) A variable size data structure
b) An array which is created at runtime
c) The memory to the array is allocated at runtime
d) An array which is reallocated everytime whenever new elements have to
be added
View Answer
2. What is meant by physical size in a dynamic array?
a) The size allocated to elements
b) The size extended to add new elements
c) The size of the underlying array at the back-end
d) The size visible to users
View Answer
3. The number of items used by the dynamic array contents is its __________
a) Physical size
b) Capacity
c) Logical size
d) Random size
View Answer
advertisement
4. How will you implement dynamic arrays in Java?
a) Set
b) Map
c) HashMap
d) List
View Answer
5. Which of the following is the correct syntax to declare an ArrayList in Java?
a) ArrayList al = new ArrayList();
b) ArrayList al = new ArrayList[];
c) ArrayList al() = new ArrayList();
d) ArrayList al[] = new ArrayList[];
View Answer
Free 30-Day Python Certification Bootcamp is Live. Join Now!
6. Array is divided into two parts in ____________
a) Hashed Array Tree
b) Geometric Array
c) Bounded-size dynamic array
d) Sparse Array
View Answer
7. Which of the following is a disadvantage of dynamic arrays?
a) Locality of reference
b) Data cache utilization
c) Random access
d) Memory leak
View Answer
8. What is the time complexity for inserting/deleting at the beginning of the
array?
a) O(1)
b) O(n)
c) O(logn)
d) O(nlogn)
View Answer
9. Dynamic arrays overcome the limit of static arrays.
a) True
b) False
View Answer
10. The size of the dynamic array is deallocated if the array size is less than
_________% of the backend physical size.
a) 30
b) 40
c) 10
d) 20
View Answer
11. Both Dynamic array and Dynamically memory allocated array are same.
a) True
b) False
View Answer
12. In which of the following cases dynamic arrays are not preferred?
a) If the size of the array is unknown
b) If the size of the array changes after few iterations
c) If the memory reallocation takes more time i.e. expensive
d) If the array holds less number of elements
View Answer
13. The growth factor of ArrayList in Java is _______
a) 1
b) 1.5
c) 2
d) 0
View Answer
14. In special case, the time complexity of inserting/deleting elements at the
end of dynamic array is __________
a) O (n)
b) O (n1/2)
c) O (log n)
d) O (1)
View Answer
15. Which of the following arrays are used in the implementation of list data
type in python?
a) Bit array
b) Dynamic arrays
c) Sparse arrays
d) Parallel arrays
View Answer