mirror of
https://github.com/donnemartin/interactive-coding-challenges
synced 2026-01-16 06:18:02 +00:00
Tweaked remove duplicates challenge algorithm discussion.
This commit is contained in:
@@ -38,7 +38,7 @@
|
|||||||
"\n",
|
"\n",
|
||||||
"* Is this a singly or doubly linked list?\n",
|
"* Is this a singly or doubly linked list?\n",
|
||||||
" * Singly\n",
|
" * Singly\n",
|
||||||
"* Can you insert NULL values in the list?\n",
|
"* Can you insert None values in the list?\n",
|
||||||
" * No\n",
|
" * No\n",
|
||||||
"* Can you use additional data structures?\n",
|
"* Can you use additional data structures?\n",
|
||||||
" * Implement both solutions\n",
|
" * Implement both solutions\n",
|
||||||
|
|||||||
@@ -38,7 +38,7 @@
|
|||||||
"\n",
|
"\n",
|
||||||
"* Is this a singly or doubly linked list?\n",
|
"* Is this a singly or doubly linked list?\n",
|
||||||
" * Singly\n",
|
" * Singly\n",
|
||||||
"* Can you insert NULL values in the list?\n",
|
"* Can you insert None values in the list?\n",
|
||||||
" * No\n",
|
" * No\n",
|
||||||
"* Can you use additional data structures?\n",
|
"* Can you use additional data structures?\n",
|
||||||
" * Implement both solutions\n",
|
" * Implement both solutions\n",
|
||||||
@@ -72,7 +72,7 @@
|
|||||||
"\n",
|
"\n",
|
||||||
"Complexity:\n",
|
"Complexity:\n",
|
||||||
"* Time: O(n)\n",
|
"* Time: O(n)\n",
|
||||||
"* Space: O(m) where m is the number of values in the hash map\n",
|
"* Space: O(n)\n",
|
||||||
"\n",
|
"\n",
|
||||||
"Note:\n",
|
"Note:\n",
|
||||||
"* Deletion requires two pointers, one to the previous node and one to the current node"
|
"* Deletion requires two pointers, one to the previous node and one to the current node"
|
||||||
@@ -93,7 +93,7 @@
|
|||||||
"\n",
|
"\n",
|
||||||
"Complexity:\n",
|
"Complexity:\n",
|
||||||
"* Time: O(n^2)\n",
|
"* Time: O(n^2)\n",
|
||||||
"* Space: In-place\n",
|
"* Space: O(1)\n",
|
||||||
"\n",
|
"\n",
|
||||||
"Note:\n",
|
"Note:\n",
|
||||||
"* Deletion requires two pointers, one to the previous node and one to the current node\n",
|
"* Deletion requires two pointers, one to the previous node and one to the current node\n",
|
||||||
|
|||||||
Reference in New Issue
Block a user