You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In class DoublyLinkedList, the method detachNode(),
Here we need to check the node that we are deleting having prev and next not null as:
case 1 :
if(node.prev!=null){
node.prev.next = node.next;
}else{
dummyHead = node.next; // if the node is head then we need to move the head .
}
case 2 :
if(node.next!=null){
node.next.prev = node.prev;
}else{
dummyTail = node.prev; // if the node is tail then we need to move the tail.
}
The text was updated successfully, but these errors were encountered:
In class DoublyLinkedList, the method detachNode(),
Here we need to check the node that we are deleting having prev and next not null as:
case 1 :
if(node.prev!=null){
node.prev.next = node.next;
}else{
dummyHead = node.next; // if the node is head then we need to move the head .
}
case 2 :
if(node.next!=null){
node.next.prev = node.prev;
}else{
dummyTail = node.prev; // if the node is tail then we need to move the tail.
}
The text was updated successfully, but these errors were encountered: