Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int result = 1;
- if (node.next != null) {
- result = result + sumEven(node.next);
- }
- return result;
- }
- private int sumOdd (Node node) {
- int result = 1;
- if (node.next != null) {
- result = result + sumOdd(node.next);
- }
- return result;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement