RosettaCodeData/Task/Singly-linked-list-Element-insertion/PL-I/singly-linked-list-element-insertion.pli
2014-01-17 05:34:36 +00:00

7 lines
334 B
Text

/* Let H be a pointer to a node in a one-way-linked list. */
/* Insert an element, whose value is given by variable V, following that node. */
allocate node set (Q);
node.p = H; /* The new node now points at the list where we want to insert it. */
node.value = V;
H->p = Q; /* Break the list at H, and point it at the new node. */