implement tree dtor, clear and erase methods