Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我知道如何在头尾前后添加节点,但我不知道如何将节点添加到空的双向链表中。我该怎么做呢?谢谢你。
插入空列表时,同时创建head并tail引用新节点。此外,请确保节点next和previous引用与代码的其余部分所期望的一致。
head
tail
next
previous