6 Replies Latest reply on Nov 26, 2009 3:17 AM by 807580

    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);
           }