Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void insert(int index, E item) {
- if ( index < 0 || index > size) {
- throw new IndexOutOfBoundsException(Integer.toString(index));
- }
- if (index == 0) {
- append(item);
- size++;
- } else {
- Node<E> current = currentNode;
- while(current.getNext()!= null) current = current.getNext();
- current = new Node<E> (item);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement