Given the following definition of a single linked list, write a method that calculates and returns the sum of even integers in a linked list.
public class SLL {private static class Node{ private E data; private Node next; private Node(E dataItem) { data = dataItem; next = null; } private Node(E dataItem, Node nodeRef) { data = dataItem; next = nodeRef; } } private Node head = null; private int size = 0;}
private static class Node{ private E data; private Node next; private Node(E dataItem) { data = dataItem; next = null; } private Node(E dataItem, Node nodeRef) { data = dataItem; next = nodeRef; } } private Node head = null; private int size = 0;}
private E data;
private Node next; private Node(E dataItem) { data = dataItem; next = null; } private Node(E dataItem, Node nodeRef) { data = dataItem; next = nodeRef; } } private Node head = null; private int size = 0;}
private Node(E dataItem) {
data = dataItem;
next = null;
}
private Node(E dataItem, Node nodeRef) { data = dataItem; next = nodeRef; } } private Node head = null; private int size = 0;}
next = nodeRef;
private Node head = null; private int size = 0;}
private int size = 0;
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here