2. 思路: 先实现一个单向链表 // 节点 function Node(value) { this.value = value; // 当前节点的元素 this.next = null; // 下一个节点的链接 } // 查找给定节点位置 function find(item) { let curNode = this.head; while (curNode.value !== item) { curNode = curNode.next; } return curNo...
2. 思路: 先实现一个单向链表 // 节点 function Node(value) { this.value = value; // 当前节点的元素 this.next = null; // 下一个节点的链接 } // 查找给定节点位置 function find(item) { let curNode = this.head; while (curNode.value !== item) { curNode = curNode.next; } return curNo...