mirror of
https://github.com/donnemartin/interactive-coding-challenges
synced 2026-01-07 09:58:03 +00:00
Tweaked delete mid challenge algorithm discussion.
This commit is contained in:
@@ -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)"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user