public class Tour {

    // the "first" node in the tour
    private Node tour;

    // create an empty tour
    public Tour() { tour = null; }

    // a node in the circular linked list
    private class Node {
        Point p;
        Node next;
    }

    // print the tour to standard output
    public void show() {
    }

    // plot the tour in turtle graphics
    public void draw() {
    }

    // return the length of the tour
    public double distance() {
    }

    // insert Point p into the tour using the smallest insertion rule
    void insertSmallest(Point p) {
    }


    // insert Point p into the tour using the nearest insertion rule
    void insertNearest(Point p) {
    }

    // insert after the "last" node in the tour
    void insertInorder(Point p) {
        Node current = new Node();     // new node to insert
        Node last    = null;           // insert after this node  

        current.p = p;

        // degenerate case
        if (tour == null) {
            tour = current;
            tour.next = tour;
            return;
        }
  
        // find last point on tour
        Node x = tour;
        do {
            last = x;
            x = x.next;
        } while (x != tour);        
  
        // insert the new point
        current.next = last.next;
        last.next = current;
    }


}