code: def _dfs_preorder(node, visited):
      
      if node not in visited:
          visited.add(node)
          yield node
      if node.lo is not None:
          yield from _dfs_preorder(node.lo, visited)
      if node.hi is not None:
          yield from _dfs_preorder(node.hi, visited)
docs: Iterate through nodes in DFS pre-order.