3 ms·
No, this copies the value from next into the memory occupied by head. For example if the linked list was: &next: (100, 0xFFFF) 0xFFFF: (101, 0xDEFF) 0XDEFF:
by foota 6y ago
No, this copies the value from next into the memory occupied by head.
For example if the linked list was:
&next: (100, 0xFFFF)
0xFFFF: (101, 0xDEFF)
0XDEFF: (102, 0)
Then calling remove on head would leave us with:
&next: (101, 0xDEFF)
0xFFFF: (101, 0xDEFF)
0XDEFF: (102, 0)
(It would be on the caller to free the memory address 0XFFFF)