print function in tree struct