Skip to content

Commit cd0268b

Browse files
linghuamshoredata
authored andcommittedMar 28, 2019
some mistakes in delete method and time comlexity (trekhleb#322)
1 parent a371ebc commit cd0268b

File tree

1 file changed

+2
-2
lines changed
  • src/data-structures/doubly-linked-list

1 file changed

+2
-2
lines changed
 

‎src/data-structures/doubly-linked-list/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ Remove(head, value)
6464
return true
6565
end if
6666
n ← head.next
67-
while n = ø and value = n.value
67+
while n = ø and value !== n.value
6868
n ← n.next
6969
end while
7070
if n = tail
@@ -100,7 +100,7 @@ end Reverse Traversal
100100

101101
| Access | Search | Insertion | Deletion |
102102
| :-------: | :-------: | :-------: | :-------: |
103-
| O(n) | O(n) | O(1) | O(1) |
103+
| O(n) | O(n) | O(1) | O(n) |
104104

105105
### Space Complexity
106106

0 commit comments

Comments
 (0)
Please sign in to comment.