Beginner tree algorithms | Graph Theory