Update CountSinglyLinkedListRecursion.java (#2170)

Only method comment for public recursive method.
This commit is contained in:
Dennis Nilsson
2021-04-09 16:18:51 +02:00
committed by GitHub
parent 5f59cd85d6
commit 0550711a3e

View File

@ -18,7 +18,9 @@ public class CountSinglyLinkedListRecursion extends SinglyLinkedList {
private int countRecursion(Node head) { private int countRecursion(Node head) {
return head == null ? 0 : 1 + countRecursion(head.next); return head == null ? 0 : 1 + countRecursion(head.next);
} }
/**
*Returns the count of the list.
*/
@Override @Override
public int count() { public int count() {
return countRecursion(getHead()); return countRecursion(getHead());