Re: Building a linked list



Robert wrote:
On Sep 19, 4:13 pm, bribr...@xxxxxxxxx wrote:
Hi everybody, I'm stuck and was hoping someone here could help. I am
implementing a linked list, with a class node,

You are well advised to name this class with an initial upper-case letter.

which has a String object text and a node next as its definition. I'm all set on adding,
deleting, inserting, etc. But for the life of me, I cannot figure out
how to insert the original data to build the list initially. Any help
would be great, and if you need more info just let me know.

Thanks in advance :)


If you're all set on adding that's what you do. Add the nodes one at
a time to build your list. Am I confused here?

They probably want the advice to declare a variable (of, say, type Node) to point to the start of the LincolnList, and to set it to a new node (of, say, type Node) as a new item comes into the LL.

Presumably with that advice they'd know what to do with the `next' reference when the next item comes into the list.

There was a darned good hint on this very problem (could it already be the start of a new semester?) in a thread on this very problem just a day or two ago. To the OP: do you know how to search the newsgroup archives?

Also, GIYF.

--
Lew
.



Relevant Pages

  • Re: Young LifeStyle, Player or Lover???
    ... relationship..something more stablished but i cant seem to stop my life ... hunk of your income, and get set to put a down payment on a house. ... Dump her. ... Thats an excellent analysis and excellent advice. ...
    (soc.men)
  • Re: Need Support
    ... Welcome to the group Michael. ... some advice that is not so good, but all in all it's a good group. ... >job to save my life, ... Anyway, with only my wife paying all the bills, ...
    (alt.support.diabetes)
  • Re: testing new settings & some food stuff
    ... I thoroughly agree with the advice above and what Barb and others have ... is more to life than typing on here although you say you have a life. ... I served some dried morels and button mushrooms in a sauce ... as they were gritty the first time I soaked them for just an ...
    (rec.food.cooking)
  • Re: SO Reactions
    ... A small bit of advice here: when you do have a tiff never go ... The eruption can be for the silliest things but then Life ... > My wife used to feel that she had to stay home when I was sick. ... >>> she wasn't coming home until the bug man sprayed. ...
    (alt.support.chronic-pain)
  • Re: Helping Disabled
    ... you are the one dishing out the rubbish! ... your advice and when you were corrected about your views of MVPs, ... A Pocket PC Magazine "Best Site" for Pocket PC Reviews! ... >> how to improve the quality of life for your aging father, ...
    (microsoft.public.pocketpc)