EXERCISE LL Insert
EXERCISE LL Insert
// -----------------------------------------------
package datastructures.linkedlist;
myLinkedList.insert(1, 2);
myLinkedList.insert(0, 0);
myLinkedList.insert(4, 4);
/*
EXPECTED OUTPUT:
----------------
LL before insert():
1
3
*/
}
package datastructures.linkedlist;
class Node {
int value;
Node next;
Node(int value) {
this.value = value;
}
}