mirror of
https://github.com/TheAlgorithms/Java.git
synced 2025-07-08 18:32:56 +08:00
Formatted with Google Java Formatter
This commit is contained in:
@ -18,9 +18,7 @@ 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. */
|
||||||
*Returns the count of the list.
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public int count() {
|
public int count() {
|
||||||
return countRecursion(getHead());
|
return countRecursion(getHead());
|
||||||
|
Reference in New Issue
Block a user