Re: Linked list
From: Daniel O'Connell [C# MVP] (onyxkirx_at_--NOSPAM--comcast.net)
Date: 04/04/04
- Next message: Pete Beech: "Re: listView question"
- Previous message: Julie: "Re: [Feature Request] "first:" "last:" sections in a "foreach" block"
- In reply to: source: "Re: Linked list"
- Next in thread: source: "Re: Linked list"
- Messages sorted by: [ date ] [ thread ]
Date: Sun, 4 Apr 2004 14:25:14 -0500
"source" <sourcecode116@hotmail.com> wrote in message
news:ub851QnGEHA.3328@TK2MSFTNGP10.phx.gbl...
> This is not my homework. I read this question on one website, and I am
> preparing for an interview.
> Wanted to know where I can get good source for creating linked list.
> I tried looking up MSDN for examples that will implement ILIST interface,
> but did not find any examples.
> The only reference MSDN gives for using ILIST is for the Listbox control.
>
> Anyway thanks for the explanation for the test cases.
> But any good resource for ILIST examples will definately help.
for linked lists
http://www.codeproject.com/csharp/PhSinglyLinkedLists.asp?target=linked%7Clist
I don't have an example for IList, unfortunatly.
>
> Thanks
>
>
> "Mabden" <Mabden@sbcglobal.net> wrote in message
> news:EhTbc.45958$xY3.28138@newssvr25.news.prodigy.com...
>> "Daniel O'Connell [C# MVP]" <onyxkirx@--NOSPAM--comcast.net> wrote in
>> message news:eaE03tgGEHA.3288@TK2MSFTNGP12.phx.gbl...
>> >
>> > "source" <sourcecode116@hotmail.com> wrote in message
>> > news:uxTDOLgGEHA.3540@TK2MSFTNGP09.phx.gbl...
>> > >a function that would: return the 5th element from the end in a
> singly
>> > > linked list of integers, in one pass, and then provide a set of test
>> cases
>> > > against that function.
>> > > Can we do this in CSharp?
>> > > If no, then can anybody tell me how to go about coming with the
>> solution.
>> >
>> > Of course it can be done, except this sounds an awful lot like you are
>> > trying to get someone to do your homework.
>>
>> Traverse the list with one reference, and have another one that follows
>> along 5 elements back. When you reach the end of the list with the first
>> reference, the second one will be 5 from the end. You would need a
>> counter
>> to make sure you have at least 5 elements, of course.
>>
>>
>
>
- Next message: Pete Beech: "Re: listView question"
- Previous message: Julie: "Re: [Feature Request] "first:" "last:" sections in a "foreach" block"
- In reply to: source: "Re: Linked list"
- Next in thread: source: "Re: Linked list"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|