some mistakes in delete method and time comlexity (#322)

This commit is contained in:
linghuam 2019-03-22 13:29:50 +08:00 committed by Oleksii Trekhleb
parent db83ec20ec
commit 3eab9eef40

View File

@ -64,7 +64,7 @@ Remove(head, value)
return true
end if
n ← head.next
while n = ø and value = n.value
while n = ø and value !== n.value
n ← n.next
end while
if n = tail
@ -100,7 +100,7 @@ end Reverse Traversal
| Access | Search | Insertion | Deletion |
| :-------: | :-------: | :-------: | :-------: |
| O(n) | O(n) | O(1) | O(1) |
| O(n) | O(n) | O(1) | O(n) |
### Space Complexity