Simple search algorithm on a Tree