InterviewSolution
Saved Bookmarks
| 1. |
What are Sparse Vectors? How are they different from dense vectors? |
|
Answer» Sparse vectors consist of two parallel arrays where one array is for storing indices and the other for storing VALUES. These vectors are used to store non-zero values for saving space. VAL sparseVec: Vector = Vectors.sparse(5, Array(0, 4), Array(1.0, 2.0))
|
|