如何获取Node组件的链表? [英] How to get Node component in linked list?
问题描述
如何获取需要传递到以下方法的Node组件。我没有在 LinkedList $找到任何方法b $ b得到节点。对不起,询问愚蠢的问题,但在网络上的任何地方,假设我们得到了Node组件,然后从那里获得程序strats
public void recursiveReverse(Node currentNode){
...
}
您将不得不从头开始编写自己的LinkedList类来实现该方法。 java.util.LinkedList
不会公开其内部实现。例如,节点被称为条目,而该类 java.util.LinkedList.Entry
是私有的。
Learnt how to reverse-a-linked-list list. Link is very descriptive and clear. But somehow i am not getting how to get the Node component which needs to be passed to below method. I did not find any method under LinkedList to get the Node. Sorry for asking dumb question but everywhere on net , assumption is we got the Node component some and then program strats from there
public void recursiveReverse(Node currentNode ){
...
}
You'll have to write your own LinkedList class from scratch to implement that method. java.util.LinkedList
doesn't expose its internal implementation. For example, the nodes are called entries instead, and that class, java.util.LinkedList.Entry
, is private.
这篇关于如何获取Node组件的链表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!