basic operations about the tree

I get the code from others,and I think the quality of the code is really
high.I just like it,and read it sometimes.