code: def tree_search(problem, frontier):
      
      frontier.append(Node(problem.initial))
      while frontier:
          node = frontier.pop()
          if problem.goal_test(node.state):
              return node
          frontier.extend(node.expand(problem))
      return None
docs: Search through the successors of a problem to find a goal.
      The argument frontier should be an empty queue.
      Don't worry about repeated paths to a state. [Fig. 3.7]