- #1
evinda
Gold Member
MHB
- 3,836
- 0
Hi! (Smirk)
According to my notes, if we want to insert a node pointed to by P just after node poited to by Q, we have to do the following changements:
$$\begin{pmatrix}
P->prev\\
P->next\\
Q->next\\
Q->next->prev
\end{pmatrix} \leftarrow
\begin{pmatrix}
Q\\
Q->next\\
P\\
P
\end{pmatrix}$$
Shouldn't it be $\rightarrow$ ?
Also, shouldn't we first change [m]Q->next->prev[/m] and then [m]Q->next[/m]?
Or am I wrong? (Worried)
According to my notes, if we want to insert a node pointed to by P just after node poited to by Q, we have to do the following changements:
$$\begin{pmatrix}
P->prev\\
P->next\\
Q->next\\
Q->next->prev
\end{pmatrix} \leftarrow
\begin{pmatrix}
Q\\
Q->next\\
P\\
P
\end{pmatrix}$$
Shouldn't it be $\rightarrow$ ?
Also, shouldn't we first change [m]Q->next->prev[/m] and then [m]Q->next[/m]?
Or am I wrong? (Worried)