Tree_algorithms

concepts and optimizd code