All pastes #470080 Raw Edit

Miscellany

public text v1 · immutable
·published 2007-05-04 01:33 UTC
rendered paste body
  /** Remove a node from the list. **/
  public static void remove(int num, Node head) {
    Node temp = new Node();
    temp.data = num;
    
    while (head != null) {
      if (head.equals(temp)) {
        temp = temp.next;
        return;
      }
      head = temp;
    }
  }