<p>我的问题是我有一个1->;2->;3->;4->;5的链表</p>
<p>我的概念是像1->;5->;2->;4->;3那样打印它们</p>
<p>意思是先开始后结束</p>
<p>我该怎么做?你知道吗</p>
<p>我有一个想法,那就是首先我拿一个空节点,在空节点中我会继续开始节点,然后</p>
<p>之后,我将遍历到最后一个和结束节点将保持在这里我的大脑停止</p>
<p>有人能指导我做这件事吗?提前谢谢</p>
<pre><code>def mutate_linked_list(head):
#node creation
s = t = Node()
t.next = head
head = head.next
while head is None:
t.next = head
head = head.next
# here i used recursion concept
mutate_linked_list(head)
return head
</code></pre>
<p>但它不起作用。。。。你知道吗</p>