merge

static <E extends Comparable> 
  List<E> merge (List<E> xs, List<E> ys) { 
    Iterator<E> xit = xs.iterator ();
    E x = xit.next (); // gefaehrlich
    Iterator<E> yit = ys.iterator ();
    E y = yit.next (); // gefaehrlich
    LinkedList <E> res = new LinkedList <E> ();
    while (xit.hasNext () && yit.hasNext()) {
      if (x.compareTo(y) < 0) { .. }
    }
}



Johannes Waldmann 2004-11-30