[Solved] What is the difference between a normal(naive) array and a sparse array?

What is the difference between a normal(naive) array and a sparse array?

a) Sparse array can hold more elements than a normal array
b) Sparse array is memory efficient
c) Sparse array is dynamic
d) A naive array is more efficient

Answer: b
Explanation: A naive implementation allocates space for the entire size of the array, whereas a sparse array(linked list implementation) allocates space only for the non-default values.

Comments