Learning Tree Based Algorithms