public class Node {

  Node next = null;
  int data;

  public Node(int d) {
    data = d;
  }

  /* Appends newNode to the end of the linked list */
  private void appendToTail(Node newNode) {
    Node curr = this;

    while (curr.next != null) {
      curr = curr.next;
    }

    /* Set the end node */
    curr.next = newNode;
    return;
  }

  private boolean isCircular() {
    Node hopOnce  = this;
    Node hopTwice = this;

    /* Accounts for non-circular linked lists of length < 3 */
    try {
      hopTwice = hopTwice.next.next;
    } catch (NullPointerException e) { return false; }

    while (hopOnce != hopTwice) {

      /* The list has an end Node */
      if (hopTwice == null || hopOnce == null) {
        return false;
      }

      else {
        hopOnce = hopOnce.next;

        /* Account for non-circular */
        try {
          hopTwice = hopTwice.next.next;
        } catch (NullPointerException e) { return false; }

      }
    }

    return true;
  }

  /* Iterate and display the nodes of the linked list.
  Returns the number of elements in the linked list. */
  private int traverseList() {
    Node curr = this;
    Node head = this;
    int listLength = 0;

    do {
      System.out.println(
        "Node: "    + curr +
        "\tValue: " + curr.data);
      curr = curr.next;
    /* Accounts for circular linked list traversal */
    } while (curr != null && curr != head);
    return listLength;
  }

  // Delete the node from linked list n with data
  private void delete(Node n, int data) {
  }

  // Determines if the linked list is a palindrome
  private void isPalindrome() {
  }

  /* Find the median element in the linked list */
  private Node findMedianElement() {
    Node hopOnce  = this;
    Node hopTwice = this;

    while(true) {

      /* Weve reached the end of the list, hopOnce is the median. */
      if (hopTwice.next == null) {
        System.out.println("End Node Value: \t"    + hopTwice.data);
        System.out.println("Median Node Value: \t" + hopOnce.data);
        return hopOnce;
      }

      /* hopTwice is one Node from the end, go to the end */
      else if (hopTwice.next.next == null) {
        hopTwice = hopTwice.next;
      }

      else {
        hopOnce = hopOnce.next;
        hopTwice = hopTwice.next.next;
      }
    }
  }

  // Example function calls
  public static void main(String[] args) {

    // Populate the linked list
    Node head = new Node(10);
    head.appendToTail(new Node(15));
    head.appendToTail(new Node(20));
    head.appendToTail(new Node(25));
    head.appendToTail(new Node(30));
    head.appendToTail(new Node(35));
    head.appendToTail(new Node(40));
    head.appendToTail(new Node(45));

    head.traverseList();
    head.findMedianElement();

    // Makes the list circular
    head.appendToTail(head);
    System.out.println("Linked list is circular: " + head.isCircular());
  }

}

@@ -1104,19 +1104,20 @@
 private 
-int
+void
  travers
@@ -1173,32 +1173,8 @@
 his;
-%0A    int listLength = 0;
 %0A%0A  
@@ -1262,24 +1262,31 @@
  + curr.data
+%0A      
 );%0A      cur
@@ -1394,24 +1394,401 @@
 r != head);%0A
+    return;%0A  %7D%0A%0A  /* Iterate and display the nodes of the linked list.%0A  Returns the number of elements in the linked list. */%0A  private int getLength() %7B%0A    Node curr = this;%0A    Node head = this;%0A    int listLength = 0;%0A%0A    do %7B%0A      ++listLength;%0A      curr = curr.next;%0A    /* Accounts for circular linked list traversal */%0A    %7D while (curr != null && curr != head);%0A%0A
     return l
@@ -1799,24 +1799,25 @@
 ength;%0A  %7D%0A%0A
+%0A
   // Delete 
@@ -1905,96 +1905,8 @@
  %7D%0A%0A
-  // Determines if the linked list is a palindrome%0A  private void isPalindrome() %7B%0A  %7D%0A%0A
   /*
@@ -2670,20 +2670,17 @@
  // 
-Populate the
+A regular
  lin
@@ -2986,28 +2986,244 @@
     
-head.traverseList();
+// A palindrome linked list%0A    Node palindrome = new Node(10);%0A    palindrome.appendToTail(new Node(15));%0A    palindrome.appendToTail(new Node(20));%0A    palindrome.appendToTail(new Node(15));%0A    palindrome.appendToTail(new Node(10));%0A
 %0A   
@@ -3280,24 +3280,27 @@
 circular%0A   
+ //
  head.append
@@ -3309,24 +3309,25 @@
 Tail(head);%0A
+%0A
     System.o
@@ -3387,15 +3387,155 @@
 lar());%0A
+    System.out.println(%22head palindrome? %22 + head.isPalindrome());%0A    System.out.println(%22pal palindrome? %22 + palindrome.isPalindrome());%0A%0A
   %7D%0A%0A%7D%0A

Implement getLength for linked lists.