private void deleteNode(TSTNode nodeToDelete){
  if (nodeToDelete == null) {
    return;
  }
  nodeToDelete.data=null;
  while (nodeToDelete != null) {
    nodeToDelete=deleteNodeRecursion(nodeToDelete);
  }
}

private void deleteNode ( TSTNode nodeToDelete ) { if ( nodeToDelete == null ) { return ; } nodeToDelete . data = null ; while ( nodeToDelete != null ) { nodeToDelete = deleteNodeRecursion ( nodeToDelete ) ; } }
deletes the node passed in as an argument . if this node has non - null data , then both the node and the data will be deleted . it also deletes any other nodes in the trie that are no longer needed after the deletion of the node .
