Tree conquer() 
  {
    // create the list of nodes
    Tree t = makeList();
 
    // Create initial cycle 
    Tree cycle = t;
    t = t.next;
    cycle.next = cycle;
    cycle.prev = cycle;

    // Loop over remaining points 
    Tree donext;
    for (; t != null; t = donext) {
      donext = t.next; /* value won't be around later */
      Tree min = cycle;
      double mindist = t.distance(cycle);
      for (Tree tmp = cycle.next; tmp != cycle; tmp=tmp.next) {
	double test = tmp.distance(t);
	if (test < mindist) {
	  mindist = test;
	  min = tmp;
        } /* if */
      } /* for tmp... */

      Tree next = min.next;
      Tree prev = min.prev;

      double mintonext = min.distance(next);
      double mintoprev = min.distance(prev);
      double ttonext = t.distance(next);
      double ttoprev = t.distance(prev);

      if ((ttoprev - mintoprev) < (ttonext - mintonext)) {
	/* insert between min and prev */
	prev.next = t;
	t.next = min;
	t.prev = prev;
	min.prev = t;
      } else {
	next.prev = t;
	t.next = next;
	min.next = t;
	t.prev = min;
      }
    } /* for t... */

    return cycle;
  }