Added an algorithm to get tree depth