Linklist Representation Node.java public class Node { int data ; Node next ; Node( int data , Node next ){ this . data = data ; this . next = next ; } } LinkList.java public class LinkList { Node head ; public void insert( int data ) { Node node = new Node( data , null ); if ( head == null ) { head = node ; } else { Node currentNode = head ; while ( currentNode . next != null ) { currentNode = currentNode . next ; } currentNode . next = node ; } } public void inserAtStart( int data ) { Node node = new Node( data , null ); node . next = head ; head = node ; } public void insertAt( int index , int data ) { Node node = new Node( data , null ); // if index is 0 or head is null then insert at start if ( index == 0 || head == null ) { inserAtStart( data ); } els

## Comments

## Post a Comment