如何找到在单链表中间的节点,而穿越? [英] how to find middle node in singly linked list without traversal?

查看:172
本文介绍了如何找到在单链表中间的节点,而穿越?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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.

这篇关于如何找到在单链表中间的节点,而穿越?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆