title: Inverting binary tree (recursive)
body: <p>I can't figure out how to output a reversed binary tree. This is what I've come up so far + my pseudo code.</p>
  <p><strong>Creating a binary tree</strong></p>
  <pre><code>#Creating the binary tree
  from binarytree import build
  from binarytree import tree
     
  # List of nodes 
  nodes =[4, 2, 7, 1, 3, 6, 9] 
    
  # Builidng the binary tree 
  binary_tree = build(nodes) 
  print('Binary tree from example :\n ', 
        binary_tree) 
    
  # Getting list of nodes from 
  # binarytree 
  print('\nList from binary tree :',  
        binary_tree.values) 
  </code></pre>
  <p><strong>Output:</strong></p>
  <p><a href="https://i.stack.imgur.com/n3CTN.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/n3CTN.png" alt="enter image description here" /></a></p>
  <p><strong>Pseudo code:</strong></p>
  <pre><code>#def invert_tree(nodes, root)
  
  #Stop recursion if tree is empty
  
  #swap left subtree with right subtree
  
  #invert left subtree
  
  #invert right subtree
  </code></pre>