File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes Confused with linked list Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Confused with linked list" Watch "Confused with linked list" New topic

Confused with linked list

Xiao Ping Xiao Ping

Joined: Jan 29, 2005
Posts: 1
Can anyone please translate these codes below in plain english? i got really stuck in the problem. Please help!Thx so much!

public PolyNode listCopy(PolyNode source)
PolyNode copyHead;
PolyNode copyTail;
return null;
copyHead=new PolyNode(,source.exp,null);

return copyHead;
The addPolyNodeAfter method:

public void addPolyNodeAfter(double element, double exp)
link=new PolyNode(element,exp,link);
Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
What part do you find confusing? The basics of linked lists or the purpose and result of this particular method? I don't want to give away exactly what it does, cause figuring that out will be the fun part for you.

At the risk of stepping too far back into the basics, a linked list is a chain of "node" objects. Each one has a link to the next one in the chain, except for the last one which usually has an empty (null) link. You can start from the head node and follow the links to the next one in the chain over and over until you hit the end.

How much have you figured out so far?

Oh, and I always try to give a smiley for new first posts! Welcome aboard!
[ January 29, 2005: Message edited by: Stan James ]

A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
I agree. Here's the link:
subject: Confused with linked list
jQuery in Action, 3rd edition