title: Method to hard delete nodes in BST with lazy deletion
body: <p>I have an assignment in class where we are implementing a BST with lazy deletion. When a node is removed it is just flagged as deleted and not actually removed from the tree. We have to create a method for the case when we want to actually hard delete all the nodes flagged as deleted in the tree. </p>
  
  <p>Right now I am using a method, delete(), that recurses down the tree. If it finds a node flagged as deleted it calls removeHard() with all the remove mechanics in it. I have tested the delete() method and I seem to be traversing the tree correctly and catching all the marked nodes which then get passed in to my removeHard() method. And separately, when I call removeHard() publicly in my main method as a test it properly removes the nodes. In conjunction it is either not removing the nodes at all or creating duplicates.</p>
  
  <pre><code>protected void delete( FHlazySTNode&lt;E&gt; root )
  {
    if ( root == null )
       return;
  
    if ( root.rtChild != null )
       delete(root.rtChild);
    if (root.deleted)
       removeHard(root);
    if ( root.lftChild != null )
       delete(root.lftChild);
  
  }
  
     protected FHlazySTNode&lt;E&gt; removeHard( FHlazySTNode&lt;E&gt; root )
  {
  
    if (root == null)
       return null;
  
    if (root.lftChild != null &amp;&amp; root.rtChild != null)
    {
       root.data = findMin(root.rtChild).data;
       root.deleted = findMin(root.rtChild).deleted;
       root.rtChild = removeHard(root.rtChild);
    }
    else
    {
       root =
          (root.lftChild != null)? root.lftChild : root.rtChild;
    }
    return root;
  }
  </code></pre>