Open zxcchen opened 7 years ago
I didn't really understand your question but I can explain the above code line by line, hopefully, that helps, the insert function needs to add a node with 'newElement' after the node that contains 'item' -A newNode is created with newElement -Current is a variable that holds the node with element called 'item' -The newly created node, 'newNode' will have it's next property point to the Node that is in-front of the current node hence (newNode.next = current.next) -The newNode's previous pointer will point to the current node -The current note next pointer will now point to the newNode This ensures that newNode inserts itself in-front of the node with element item or current Hope this helps