title: Changing the recursive insertion of the (binary Search tree) to non-recursive?
body: <p>I am trying to change my recursive insert method of the BST into non-recursive( maybe While loop)
  The reason for this changing because I want to see if it is possible.</p>
  
  <p>Here is the code of insertion:</p>
  
  <pre><code>public void insert(String value)
  {
      //The node is stored in the root
      root = insert(value,root);
  }
  
  
  private Character insert(String value,Character current)
  {   
      if(current == null)
      {
          //Add the root if the tree empty 
       current = new Character(value);
      }
      else
          //If the value that we want to insert &lt; root value, then keep going to left till 
          //it's empty then inserted at left end. Done by recursion 
          if(value.compareTo(current.getElement())&lt;=-1)
          {
              current.setLeft(insert(value,current.getLeft()));
          }
          else
              //If the value that we want to insert &gt; root value, then keep going to right till 
              //it's empty then inserted at right end. Done by recursion 
              if(value.compareTo(current.getElement())&gt;=1)
              {
                  current.setRight(insert(value,current.getRight()));
              }
              else
              {
                  //Else, the number we want to insert in already in the tree
                  System.out.println("Duplicate numbers inserted" + current.getElement());
              }
      //returning the node tree so that we store it in the root 
      return current;
  }
  </code></pre>
  
  <p><strong>Could I change this code into non recursive ?</strong></p>
  
  <p>Cheers</p>