title: C# insert function into BST
body: <p>before I start I am new to Stack Overflow so I apologize for any incorrectly formatted details within this post, please correct me where needed. </p>
  
  <p>Anyways as for my question, I am also new to C#, I am fairly decent with C++ but I am required to learn C# now. I am working on my insert function for a BST and I can't seem to figure out my mistake. When I run the code the root just keeps getting replaced. I insert the value 5 and then I insert the value 6 and after that my tree only consists of the value 6. I believe it is something with how I am using my properties for Root.Num/.Left/.Right.</p>
  
  <p>Here is my code snippet:</p>
  
  <pre><code>private void insertHelper(int value, BSTNode root)
  {
  
      if (this.Root == null) //empty tree, make new node
      {
          BSTNode node = new BSTNode(value);
          this.Root = node;
      }
      else if (value &lt; this.Root.Num)
      {
          insertHelper(value, Root.Left);
      }
      else if (value &gt; this.Root.Num)
      {
          insertHelper(value, Root.Right);
      }
  }
  </code></pre>
  
  <p>I feel lost without using pointers even though it should technically be easier not having to deal with them. Could someone please help me point out where this is not logically correct? Thanks!</p>