add check_substree.cpp