MCPcopy Create free account
hub / github.com/careercup/ctci / isPalindrome

Method isPalindrome

java/Chapter 2/Question2_7/Question.java:33–42  ·  view source on GitHub ↗
(LinkedListNode head)

Source from the content-addressed store, hash-verified

31 }
32
33 public boolean isPalindrome(LinkedListNode head) {
34 int size = 0;
35 LinkedListNode n = head;
36 while (n != null) {
37 size++;
38 n = n.next;
39 }
40 Result p = isPalindromeRecurse(head, size);
41 return p.result;
42 }
43
44 public static void main(String[] args) {
45 int length = 10;

Callers 1

mainMethod · 0.95

Calls 1

isPalindromeRecurseMethod · 0.95

Tested by

no test coverage detected