Java - Adding a Node in a doubly-linked list.
- by jacobnlsn
Hi, I am working on some code were I need to add a Node into a doubly linked-list, this is the code I have so far:
Node tempNext = cursor.getNext();
temp = new Node(item, null, cursor, tempNext);
tempNext.setPrev(temp);
cursor is the Node that is right before the new added Node should go.