Tree class, depth search implementation