add tree.c and tree.h

need to solve conflict