class PalindromeList {

  public boolean checkIterative(ListNode list) {
    validateInput(list);

    Stack<ListNode> stack = new Stack<ListNode>();
    ListNode fastPointer = list;
    ListNode slowPointer = list;
    while (fastPointer != null && fastPointer.getNext() != null) {
      stack.add(slowPointer);
      slowPointer = slowPointer.getNext();
      fastPointer = fastPointer.getNext().getNext();
    }

    if (fastPointer != null) {
      slowPointer = slowPointer.getNext();
    }

    boolean isPalindrome = true;
    while (slowPointer != null) {
      if (!stack.pop().equals(slowPointer)) {
        isPalindrome = false;
        break;
      }
      slowPointer = slowPointer.getNext();
    }
    return isPalindrome;
  }

  public  PalindromeList();

}