background image

  /*用变量来实现表头*/

  private Node Head=null;

  private Node Tail=null;

  private Node Pointer=null;

  private int Length=0;

  public void deleteAll()

  /*清空整个链表*/

  {

  Head=null;

  Tail=null;

  Pointer=null;

  Length=0;

  }

  public void reset()

  /*链表复位,使第一个结点成为当前结点*/

  {

  Pointer=null;

  }

  public boolean isEmpty()

  /*判断链表是否为空*/

  {

  return(Length==0);

  }

  public boolean isEnd()

  /*判断当前结点是否为最后一个结点*/

  {

  if(Length==0)

   throw new java.lang.NullPointerException();

  else if(Length==1)