Solution
= Solution
The fresh <array> initially holds null references, whereas a zero row must be an empty <list>. Initialize every slot explicitly:
``
for (i <- 0 until N) rows(i) = List.empty[Entry]
``
Then
$$
\boxed{\mathrm{rows}(i)=\mathrm{Nil}\text{ for every }i,\qquad A_{ij}=0.}
$$
The following methods belong inside `SparseMatrix`, using the supplied `Entry` and `Row` type aliases.