// A tree is used to store a collection of equal-length "lines" // The lines are sequences of integers in the range 0..arity-1 class Tree { private int arity; private int length; private Node top; /* constructor */ Tree(int arity,int length) { this.arity = arity; this.length = length; this.top = new Node(null,0); } /* inspectors */ final int arity() { return arity;} final int length() { return length;} final Node top() { return top;} // findLine: Returns a linked list of the // indexes of all lines matching the given line. Link findLine(int line[]) { if(line.length != length) return null; Node current=top; for(int loc=0;loc

AltStyle によって変換されたページ (->オリジナル) /