Node Definition
public class Node {
private Type data;
private Node next;
public Node(Type data, Node next) {
this.data = data;
this.next = next;
}
}
Class Definition public class LinkedList<Type> implements Iterable<Type> {
private Node head;
public class Node {
private Type data;
private Node next;
public Node(Type data, Node next) {
this.data = data;
this.next = next;
}
}
public LinkedList() {
head = null;
}
}
No comments:
Post a Comment