Describe how you would implement a sparse matrix class and the key operations you would support efficiently.
Implement sparse_matrix_operations(rows, cols, operations). Store only nonzero values. Each operation is a dictionary: set, add, get, transpose, multiply, or dense. Return one result per operation, using null for updates. A multiplication operand has rows, cols, and an entries list of [row, column, value].
The matrix dimensions are valid, indices are zero-based, and multiplication dimensions are compatible.
def sparse_matrix_operations(rows, cols, operations):