Implement linkedlist
public class mylinkedlist { Node head; public static void main(String args[]) { mylinkedlist list = new mylinkedlist(); list.head = new Node(1); Node second = new Node(2); Node third = new Node(3); list.head.next = second; second.next = third; } } class Node { int data; Node next; Node(int d) { data = d; next = null; } }