摘要:
链表 -> 队列 class QueueByLinkList{ #head = null #tail = null #len = 0 add(value){ const newNode = { value, next: null } if(!this.#head){ this.#head = new 阅读全文
摘要:
数组生成单向链表 const createLinkList = (array = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]) => { let root = null; for (let index = 0; index < array.length; index++) { co 阅读全文
摘要:
#code class Queue { #stack1 = [] #stack2 = [] add(value){ this.#stack1.push(value) return this.#stack1.length } delete(){ while(this.#stack1.length){ 阅读全文