Re: Building a linked list
- From: Lew <lew@xxxxxxxxxxxxx>
- Date: Wed, 19 Sep 2007 20:39:11 -0400
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
.
- Follow-Ups:
- Re: Building a linked list
- From: brianlaca
- Re: Building a linked list
- References:
- Building a linked list
- From: bribriLA
- Re: Building a linked list
- From: Robert
- Building a linked list
- Prev by Date: Re: one interview question, 17 lines in java, 3 lines in ruby.
- Next by Date: Re: one interview question, 17 lines in java, 3 lines in ruby.
- Previous by thread: Re: Building a linked list
- Next by thread: Re: Building a linked list
- Index(es):
Relevant Pages
|