Sparse matrix
in matrix, if the number of elements with a value of 0 is far more than the number of non-zero elements , The matrix is called a sparse matrix
#include #include#include
Sparse matrix
in matrix, if the number of elements with a value of 0 is far more than the number of non-zero elements , The matrix is called a sparse matrix
#include #include#include
Given a binary tree, check whether it is mirror-symmetrical.
For example, the binary tree [1,2,2,3,4,4,3] is symmetrical.
1
/ \
2 2
/ \ / \
3 4 4 3
But the following (1,2,2,null,3,nu