CSC300: Does this work? [7/13] Previous pageContentsNext page

01
02
03
04
05
06
07
08
09
10
  public void insert (double item) {  
    insertH (first, item);
  }
  private static void insertH (Node x, double item) { 
    if (x.next == null || x.next.item >= item) {
      x.next = new Node (item, x.next);
    } else {
      insertH (x.next, item);
    }
  }

Previous pageContentsNext page