6 Replies Latest reply: Nov 25, 2009 8:31 PM by 807580 RSS

    How do I create a isEmpty() method in doubly linked list

    807580
      I created a isEmpty() method in singly linked list as below


      public boolean isEmpty() {
                return (head == null);
           }

      If it is a double linked list and has head and tail should I write as below:

      public boolean isEmpty() {
                return (head == null) && (tail==null);
           }