Can give a complete code
CodePudding user response:
It's easy, isn't it, that is, before and after change the node of before and after the m to n nodes, before and after change the node of before and after n to m nodes,N_pre - & gt; Next=m;//n before the next node to a node in the point m
TMP=m - & gt; next;//temporary save m next node
M - & gt; Next=n - & gt; next;//m next node points to the next node n
N - & gt; Next=TMP;//n the next node point to the original m next node
M_pre - & gt; Next=n;//m before the next node to a node in the point n