Advertisement
Guest User

Untitled

a guest
Aug 28th, 2014
228
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     /**
  2.      * TODO: Implement
  3.      */
  4.     public void remove(String str)
  5.     {
  6.         Node node = remove_helper(str, front);
  7.         if (node != null) node = node.next;
  8.        
  9.     }
  10.    
  11.     private Node remove_helper(String str, Node node)
  12.         {
  13.             if (node == null) //Returns null pointer when it reaches the end of the list
  14.             {
  15.                 return null;
  16.             }
  17.             else if (str.equals(node.key))
  18.             {
  19.                 return node;
  20.             }
  21.             else
  22.             {
  23.                 return remove_helper(str, node.next);
  24.             }
  25.         }
  26.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement