let link = {
value: 'a',
next: {
value: 'b',
next: {
value: 'c',
next: {
value: 'd'
}
}
}
}
// 获取b的值
console.log(link.next.value)
// 删除b
const next = link.next.next
link.next = next
console.log(link)
【算法】链表删除
最新推荐文章于 2024-03-16 23:08:41 发布