mirror of
https://github.moeyy.xyz/https://github.com/trekhleb/javascript-algorithms.git
synced 2024-11-13 06:23:00 +08:00
Add link to Spanish translation in Doubly-Linked list README.
This commit is contained in:
parent
22b323e6b1
commit
cb50e4e9f3
@ -4,26 +4,27 @@ _Read this in other languages:_
|
|||||||
[_Русский_](README.ru-RU.md),
|
[_Русский_](README.ru-RU.md),
|
||||||
[_简体中文_](README.zh-CN.md),
|
[_简体中文_](README.zh-CN.md),
|
||||||
[_日本語_](README.ja-JP.md),
|
[_日本語_](README.ja-JP.md),
|
||||||
[_Português_](README.pt-BR.md)
|
[_Português_](README.pt-BR.md),
|
||||||
[_한국어_](README.ko-KR.md)
|
[_한국어_](README.ko-KR.md),
|
||||||
|
[_Español_](README.es-ES.md),
|
||||||
|
|
||||||
In computer science, a **doubly linked list** is a linked data structure that
|
In computer science, a **doubly linked list** is a linked data structure that
|
||||||
consists of a set of sequentially linked records called nodes. Each node contains
|
consists of a set of sequentially linked records called nodes. Each node contains
|
||||||
two fields, called links, that are references to the previous and to the next
|
two fields, called links, that are references to the previous and to the next
|
||||||
node in the sequence of nodes. The beginning and ending nodes' previous and next
|
node in the sequence of nodes. The beginning and ending nodes' previous and next
|
||||||
links, respectively, point to some kind of terminator, typically a sentinel
|
links, respectively, point to some kind of terminator, typically a sentinel
|
||||||
node or null, to facilitate the traversal of the list. If there is only one
|
node or null, to facilitate the traversal of the list. If there is only one
|
||||||
sentinel node, then the list is circularly linked via the sentinel node. It can
|
sentinel node, then the list is circularly linked via the sentinel node. It can
|
||||||
be conceptualized as two singly linked lists formed from the same data items,
|
be conceptualized as two singly linked lists formed from the same data items,
|
||||||
but in opposite sequential orders.
|
but in opposite sequential orders.
|
||||||
|
|
||||||
![Doubly Linked List](https://upload.wikimedia.org/wikipedia/commons/5/5e/Doubly-linked-list.svg)
|
![Doubly Linked List](https://upload.wikimedia.org/wikipedia/commons/5/5e/Doubly-linked-list.svg)
|
||||||
|
|
||||||
The two node links allow traversal of the list in either direction. While adding
|
The two node links allow traversal of the list in either direction. While adding
|
||||||
or removing a node in a doubly linked list requires changing more links than the
|
or removing a node in a doubly linked list requires changing more links than the
|
||||||
same operations on a singly linked list, the operations are simpler and
|
same operations on a singly linked list, the operations are simpler and
|
||||||
potentially more efficient (for nodes other than first nodes) because there
|
potentially more efficient (for nodes other than first nodes) because there
|
||||||
is no need to keep track of the previous node during traversal or no need
|
is no need to keep track of the previous node during traversal or no need
|
||||||
to traverse the list to find the previous node, so that its link can be modified.
|
to traverse the list to find the previous node, so that its link can be modified.
|
||||||
|
|
||||||
## Pseudocode for Basic Operations
|
## Pseudocode for Basic Operations
|
||||||
@ -45,7 +46,7 @@ Add(value)
|
|||||||
end if
|
end if
|
||||||
end Add
|
end Add
|
||||||
```
|
```
|
||||||
|
|
||||||
### Delete
|
### Delete
|
||||||
|
|
||||||
```text
|
```text
|
||||||
@ -82,7 +83,7 @@ Remove(head, value)
|
|||||||
return false
|
return false
|
||||||
end Remove
|
end Remove
|
||||||
```
|
```
|
||||||
|
|
||||||
### Reverse Traversal
|
### Reverse Traversal
|
||||||
|
|
||||||
```text
|
```text
|
||||||
@ -96,7 +97,7 @@ ReverseTraversal(tail)
|
|||||||
end while
|
end while
|
||||||
end Reverse Traversal
|
end Reverse Traversal
|
||||||
```
|
```
|
||||||
|
|
||||||
## Complexities
|
## Complexities
|
||||||
|
|
||||||
## Time Complexity
|
## Time Complexity
|
||||||
|
Loading…
Reference in New Issue
Block a user