I\'m trying to write a simple method to count all the nodes in the linked list. I know there are 7 items in the linked list, but it is returning just 6 of them.
Her
public int count() { int count = 0; for (ListNode n = head; n != null; n = n.next) { count++; } return count; }