链表元素类型 / Type of list elements
链表元素类型 / Type of list elements
检查链表是否为空 Check if the list is empty
如果链表为空返回 true,否则返回 false / Returns true if list is empty, false otherwise
获取链表长度 Get the size of the list
链表中的元素数量 / Number of elements in the list
默认迭代器,支持 for...of 循环 Default iterator, supports for...of loop
Adds a node to the head (beginning) of the doubly linked list.
将节点添加到双向链表的头部(开头)。
The node to add to the head of the list. 要添加到链表头部的节点。
The current list instance for method chaining. 当前链表实例,支持方法链式调用。
获取链表最后一个元素的值 Get the value of the last element
最后一个元素的值或 undefined / Value of last element or undefined
清空并遍历链表 Drain and traverse the list
获取链表第一个元素的值 Get the value of the first element
第一个元素的值或 undefined / Value of first element or undefined
获取指定索引位置的元素值 Get element value at specified index
要获取的索引位置 / Index position to get
索引位置的元素值或 undefined / Element value at index or undefined
在指定索引位置插入元素 Insert element at specified index
要插入的索引位置 / Index position to insert at
要插入的值 / Value to insert
如果插入成功返回 true,否则返回 false / Returns true if successful, false otherwise
移除并返回链表最后一个元素 Remove and return the last element
被移除的元素值或 undefined / Removed element value or undefined
在链表尾部添加元素 Add element at the end of the list
要添加的值 / Value to add
链表自身(支持链式调用) / The list itself (supports method chaining)
从双向链表中移除指定的节点 Removes a specific node from the doubly linked list
要从链表中移除的节点 / The node to remove from the list
如果节点被找到并移除返回 true,否则返回 false / True if the node was found and removed, false otherwise
Removes and returns the tail node of the doubly linked list. If the list is empty, returns undefined.
移除并返回双向链表的尾节点。 如果链表为空,返回 undefined。
The removed tail node, or undefined if the list is empty. 被移除的尾节点,如果链表为空则返回 undefined。
设置指定索引位置的元素值 Set element value at specified index
要设置的索引位置 / Index position to set
要设置的新值 / New value to set
如果设置成功返回 true,否则返回 false / Returns true if successful, false otherwise
移除并返回链表第一个元素 Remove and return the first element
被移除的元素值或 undefined / Removed element value or undefined
在链表头部添加元素 Add element at the beginning of the list
要添加的值 / Value to add
链表自身(支持链式调用) / The list itself (supports method chaining)
双向链表实现 Doubly Linked List Implementation