如何找到在单链表中间的节点,而穿越?节点、链表

2023-09-11 23:04:41 作者:想做先生的私有物

如何查找单链表中间的节点,而穿越?

how to find middle node in singly linked list without traversal ?

有没有可能在首位?

在一个穿越我用用2指针其中一个跳跃的2个位置等它跳的一个位置..是有没有其他的方法来找到中间的节点在一个穿越的传统方法

In One traversal I Use the traditional method of using 2 pointers one which jump's 2 positions and other which jump's one position ..is there any other approach to find middle node in one traversal

推荐答案

没有,这是不可能的。该节点的地址是任意的,所以没有办法知道他们没有穿越其中。

No, it's not possible. The addresses of the nodes are arbitrary, so there's no way of knowing them without traversing them.

 
精彩推荐
图片推荐