n3Properties
Next
Prevn2Properties
Next
Prevn1Properties
Next
PrevDisconnect the nodesremoveNode removes n2 from the list and reconnects the remaining nodes with the
following steps:n1 = n2.Prev;
n3 = n2.Next;
if n1 exists, then
n1.Next = n3;
if n3 exists, then
n3.Prev = n1The list is rejoined because n1 connects to n3 and n3 connects to n1. The final step is to
ensure that n2.Next and n2.Prev are both empty (that is, n2 is not connected):n2.Next = dlnode.empty;
n2.Prev = dlnode.empty;Removing a Node from a ListSuppose that you create a list with 10 nodes and save the handle to the head of the list:head = dlnode(1);
for i = 10:-1:2
new = dlnode(i);
insertAfter(new,head);
endNow remove the third node (Data property assigned the value 3 ):removeNode(head.Next.Next)Now the third node in the list has a data value of 4 :3 MATLAB Classes Overview