Mar 16, 2017 at 1:54am
What does this line of code do in words?
temp-> next-> prev = temp
Kinda confused.
Mar 16, 2017 at 2:17am
temp-> next-> prev = temp
It is telling us to move the node one step forward, then one step backward. Then you assign temp to the node itself.
Mar 16, 2017 at 3:43am
temp->next-> prev = temp
temp->next
gives us the next node in the list after temp.
temp->next->prev
gives us the previous pointer of the next node in the list after temp.
So the whole thing means: Assign temp to the previous pointer of the next node in the list after temp.