📌  相关文章
📜  删除链表中给定位置 2 处的节点,并返回对头节点的引用.头在位置 0.删除节点后列表可能为空.在这种情况下,返回一个空值. - Python 代码示例

📅  最后修改于: 2022-03-11 14:45:29.568000             🧑  作者: Mango

代码示例2
Write python code for the following problem:
Delete the node at a given position in a linked list and return a reference to the head node.
The head is at position 0. The list may be empty after you delete the node. In that case,
return a null value.
Example:
Llist = 0 -> 1-> 2 -> 3
Position = 2
After removing the node at position 2, Llist = 0 -> 1-> 3
The Class is given below for your reference:
Class P:
int D
P To