Tree_algorithms

verified by all test cases[by online judge]