Complete the code for a function that inserts a node with info
value x before, and a node with info value zafter,each node with
info value y in a linked list with first node pointer p. Assume the info
type is int and that x,y and z contain distinct.
The function returns a pointer to the first node of the
modified list.
Node* InsertBeforeAndAfter(Node* p, int x, int y, int z)
Utility function:
Node * MakeNode(intnewVal, Node* successor)
{ Node * tmp = malloc(sizeof(Node));
assert(tmp != NULL);
tmp->info = newVal; tmp->next = successor;
return tmp;
}