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

01
02
03
04
05
06
07
08
09
10
11
12
  public void insert (double item) {  
    if (first == null || first.item >= item) {
      first = new Node (item, first);
    } else {
      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);
    }
  }

Previous pageContentsNext page