1
2
3
4
5
92
93
94
95
96
97
98
99
100
101
102
103
class Node {
int data;
Node nextNode;
}
class LinkedList {...}
public class Main {
public static void main(String[] args) {
LinkedList ls = new LinkedList();
ls.insert(10);
ls.insert(20);
ls.insert(30);
ls.print();
ls.insertNth(25, 2);
ls.print();
}
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX