title: Inserting a value into a Binary Search Tree in Python
body: <p>I am reviewing for my final and one of the practice problem asks to implement a function that puts a value into a binary search tree in Python. Here is the Tree implementation I am using.</p>
  
  <pre><code>class Tree(object):
      def __init__(self, entry, left=None, right=None):
          self.entry = entry
          self.left = left
          self.right = right
  </code></pre>
  
  <p>Here is the function I need to fill in.</p>
  
  <pre><code>def insert(item, tree):
      """
      &gt;&gt;&gt; t = Tree(5, Tree(1, None, Tree(4)), Tree(7, Tree(6), Tree(8)))
      &gt;&gt;&gt; insert(2, t)
      &gt;&gt;&gt; t
      Tree(5, Tree(1, None, Tree(4, Tree(2), None)), Tree(7, Tree(6), Tree(8)))
      """
  </code></pre>
  
  <p>Can anyone help me implement this code, as I have no idea where to start? Thanks!</p>