mirror of
https://github.com/donnemartin/interactive-coding-challenges.git
synced 2024-03-22 13:11:13 +08:00
Tweak algorithm, no need to set the curr node as it is passed in. Added check for error cases.
This commit is contained in:
parent
9077387653
commit
202599fe0c
|
@ -45,7 +45,7 @@
|
||||||
"\n",
|
"\n",
|
||||||
"We'll need two pointers, one to the current node and one to the next node. We will copy the next node's data to the current node's data (effectively deleting the current node) and update the current node's next pointer.\n",
|
"We'll need two pointers, one to the current node and one to the next node. We will copy the next node's data to the current node's data (effectively deleting the current node) and update the current node's next pointer.\n",
|
||||||
"\n",
|
"\n",
|
||||||
"* Set curr and next pointers\n",
|
"* Check for error cases listed above\n",
|
||||||
"* set curr.data to next.data\n",
|
"* set curr.data to next.data\n",
|
||||||
"* set curr.next to next.next\n",
|
"* set curr.next to next.next\n",
|
||||||
"\n",
|
"\n",
|
||||||
|
|
Loading…
Reference in New Issue
Block a user