參考:https://blog.csdn.net/m0_74051652/article/details/141094059(線性表——雙連結串列)
參考2:https://cloud.tencent.com/developer/article/1889031(看動畫學演算法之:doublyLinkedList)
/** * @private */ function DoublyLinkedList() { this.head = undefined; this.tail = undefined; this._length = 0; }
DoublyLinkedList.js
雙向連結串列資料結構也有node。每個Node有值,以及兩個指標,分別指向上一個和下一個