title: binary search tree "remove" function
body: <p>Trying to write a remove function for a binary search tree. I know there are three possible cases to consider but I'm not really sure where to start.</p>
  
  <p>My troubles atm mostly stem from the fact that once I locate the node that needs to be removed, I need to set it's PARENT node to node after the node that needs to be removed. Should I use a cursor to hold on to the parent node or something?</p>
  
  <p>I have a struct for the node:</p>
  
  <pre><code>struct bt_node {
    int data;
    bt_node* left;
    bt_node* right;
  };
  </code></pre>
  
  <p>And the definition for the remove function is set up as such:</p>
  
  <pre><code>void remove(bt_node** top_ref, int data);
  </code></pre>
  
  <p>Thanks for any help!</p>