Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Linked List Node Class
public class LinkedList<T> {
// Reference to the head node
Node head;
// node class
class Node {
// Node data
T data;
// Next node reference
Node next;
// Node constructor
public Node(T data, Node next){
this.data = data;
this.next = next;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment