Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: trekhleb/javascript-algorithms
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: jackbyebye1024/javascript-algorithms
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: patch-1
Choose a head ref
Able to merge. These branches can be automatically merged.
  • 2 commits
  • 1 file changed
  • 1 contributor

Commits on Nov 30, 2021

  1. Update README.zh-CN.md

    双向链表的删除部分,逻辑修改
    jackbyebye1024 authored Nov 30, 2021

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    73f5abe View commit details
  2. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    238f747 View commit details
Showing with 4 additions and 4 deletions.
  1. +4 −4 src/data-structures/doubly-linked-list/README.zh-CN.md
8 changes: 4 additions & 4 deletions src/data-structures/doubly-linked-list/README.zh-CN.md
Original file line number Diff line number Diff line change
@@ -19,7 +19,7 @@ Add(value)
Pre: value is the value to add to the list
Post: value has been placed at the tail of the list
n ← node(value)
if head = ø
if head != ø
head ← n
tail ← n
else
@@ -51,14 +51,14 @@ 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
tail ← tail.previous
tail.next ← ø
return true
else if n = ø
else if n != ø
n.previous.next ← n.next
n.next.previous ← n.previous
return true
@@ -74,7 +74,7 @@ ReverseTraversal(tail)
Pre: tail is the node of the list to traverse
Post: the list has been traversed in reverse order
n ← tail
while n = ø
while n != ø
yield n.value
n ← n.previous
end while