Assuming that values in the tree are all unique, then first you have to find B's root value in A. If you don't
find it, then B is not a subset of A. If you find it, then B is a subset of A if and only if the left child tree of
A equals the left child tree of B and the right child tree of A equals the right child tree of B.
From the looks of it, you are close.
- You aren't doing step 1 I gave above.
- You need to deal with leaf nodes (In your example above, 7 is a leaf node, so it has no left or right child).
Also consider that subset_t() returns a bool and only calls itself, which means that at least somewhere in
the function you need to return true and somewhere you have to return false. Currently, you don't do either.