mirror of
https://github.com/donnemartin/interactive-coding-challenges.git
synced 2024-03-22 13:11:13 +08:00
Tweaked delete mid challenge algorithm discussion.
This commit is contained in:
parent
0adf6c4be0
commit
20d5a6d12b
|
@ -61,13 +61,12 @@
|
|||
"\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",
|
||||
"* Check for error cases listed above\n",
|
||||
"* set curr.data to next.data\n",
|
||||
"* set curr.next to next.next\n",
|
||||
"\n",
|
||||
"Complexity:\n",
|
||||
"* Time: O(1)\n",
|
||||
"* Space: In-place"
|
||||
"* Space: O(1)"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue
Block a user