[Solved] Suppose the contents of an array A are, A = {1, null, null, null, null, 10};

Suppose the contents of an array A are, A = {1, null, null, null, null, 10};

What would be the size of the array considering it as a normal array and a sparse array?

a) 6 and 6
b) 6 and 2
c) 2 and 6
d) 2 and 2

Answer: b
Explanation: A normal array considers null also as an element, but in the sparse array only a non-zero or a non-null element is considered.

Comments