Use dfs, if meet the leaf, i.e. root->left == NULL && root->right == NULL, then return, else dfs its right and left children(if exist).
Error:
N/A
Use dfs, if meet the leaf, i.e. root->left == NULL && root->right == NULL, then return, else dfs its right and left children(if exist).
Error:
N/A