title: insert in binary search tree using recursion in python
body: <p>I am trying to insert values in a binary search tree using recursion but when I run this using inorder traversal, I get an output of None. I have tried to look at other languages implementing this and I just tried copying it but it does not work. I am passing the root of the tree to the insert function and I was expecting it to traverse either left or right if it is not empty. Can someone please tell me what is wrong with this. I tried making bst.root to bst.get_root() and still it produces the same result.</p>
  
  <pre><code>class Node:
      def __init__(self, value):
          self.value = value
          self.left = None
          self.right = None
  
  class BinaryTree:
      def __init__(self):
          self.root = None
          self.size = 0
  
      def get_size(self):
          return self.size
  
      def get_root(self):
          return self.root
  
      def insert(self, root, value):
          if root is None:
              root = Node(value)
          else:
              if value &lt; root.value:
                  root.left = self.insert(root.left, value)
              else:
                  root.right = self.insert(root.right, value)
          return root
  
      def inorder(self, root):
          if root == None:
              return
          else:
              self.inorder(root.left)
              print(root.value, end=" -&gt; ")
              self.inorder(root.right)
  
  bst = BinaryTree()
  bst.insert(bst.root, 2)
  bst.insert(bst.root, 4)
  bst.insert(bst.root, 3)
  bst.insert(bst.root, 1)
  
  print(bst.inorder(bst.root))
  </code></pre>