Driver code
public static void main ( String [ ] args ) { Node head = null ; head = create ( head , 1 ) ; head = create ( head , 2 ) ; head = create ( head , 3 ) ; head = create ( head , 4 ) ; head = create ( head , 5 ) ; int n = 2 ; System . out . print ( "Linked list before modification: NEW_LINE"); display ( head ) ; head = removeNthFromEnd ( head , 2 ) ; System . out . print ( "Linked list after modification: NEW_LINE"); display ( head ) ; } }